PDA

View Full Version : How do I change domain names? (with htaccess)


vwdforum
02-23-2011, 06:01 PM
Hello all.

I currently run a forum (version 3.8) on a domain name ending .co.uk

I am just about the upgrade the forum to version 4 but would not like to use the same domain name but ending with .com

Any advice on how to do this, and how to create a htaccess file to help redirect all my existing indexed links on the new domain.

the format of the links will be identical just the domain name change.

Your help is greatly appreciated thanks Mally

OldSchoolDSL
02-24-2011, 06:57 AM
Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to NEW-domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.NEW-domain.com/$1 [r=301,nc]

Please REPLACE domain.com and NEW-domain.com with your actual domain name.

Note: This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.