Permanent redirects from old site to new without keeping old server

Hi!

I am redesigning my site and changing my domain and server. The new site will have a different file structure. What is the best way to redirect each page? I don’t want to keep my old server so would rather redirect from my domain registrar if possible.

ie. OLD SERVER: www.OLDdomain.com/portfolio/index.php?p=jen
to NEW SERVER: www.NEWdomain.com/index.php/portfolio/jen

I have loads of these to do. What would be the best way to go about it. Been reading a bit about it but can only ever find bits that seem relevant.

Thanks in advance!

Hi mattp,

Is this another WP redirection? I ask that because you’re putting the “file handler” in the middle of the path which is, in general, not a good thing to be doing.

From your single example, use the following code in the OLDdomain’s DocumentRoot (.htaccess):

RewriteEngine on RewriteCond %{QUERY_STRING} ^p=([a-z])$ RewriteRule ^([a-z]+)/index\.php$ http://www.NEWdomain.com/index.php/$1/%1 [R=301,L]

The tutorial that’s been around SitePoint for years and helped many, many members can show you how to generate mod_rewrite code and offers many examples with explanations.

Regards,

DK

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.