Redirect

maildigger

Senior Member
Joined
Jan 30, 2009
Messages
897
Reaction score
159
I have an old php website with +500 deep urls which are getting some decent Google traffic. I'm switching to wordpress and new url structure. How should I redirect this? I want to redirect all the current traffic + linkjuice to the main url.
 
Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
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
RewriteRule (.*) newdomain/$1 [R=301,L]

REPLACE newdomain in the above code with your actual domain name.

In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

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