You are here:  » 301 redirect

Support Forum



301 redirect

Submitted by npaitken on Wed, 2009-12-09 16:53 in

Hi David,

Just a quick question to make sure I'm using 301 redirects properly.

I have PT install in a subfolder of my site called /shopping. Way back, I created a number of ad-hoc php pages in /shopping which I now want to replace with Wordpress pages. Wordpress is installed in my route.

So, an example of how I'm 301 redirecting looks like this
From
www.mysite.com/shopping/redwidgets.php (ad-hod php page)
To
www.mysite.com/red-widgets/ (in wordpress)

In my .htaccess file in shopping (NOT ROUTE .htaccess) I've added this code:

RewriteBase /shopping/
RewriteRule ^redwidgets.php(.*)$ http://www.mysite.com/red-widgets/ [L,R=301]

Is it the right code?
Should it be in ".htaccess in /shopping" and NOT ".htaccess in route"?

It seems to redirect ok but as there's lots of external links pointing at the original page I just want to be sure I'm doing it properly. Also, I have quite a few other valuable pages to move too so want to be sure I'm doing it the best way.

Many thanks,
Neil

Submitted by support on Wed, 2009-12-09 18:44

Hello Neil,

That's spot-on - the rule must be in the /shopping/.htaccess, not the root.

Cheers,
David.