301 redirect from static html pages to serendipity

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

301 redirect from static html pages to serendipity

Post by carl_galloway »

I need to 301 redirect about 10 static html pages in the root folder of a domain to the new serendipity install,

eg http://url/page1.htm ---> http://url/archives/6-blah bhal.html

Can anyone help me with the .htaccess code I need to make this work without affecting s9y's ability to control 404s, archives etc?

Thanks
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Urk. I'm not having much luck with .htaccess rules right now, I'm afraid. I'll give it a try anyway. You'll want to add this block at the top of the file.

Code: Select all

RewriteEngine On
RewriteRule page1.htm archives/6-blahblah.html [R=301,L]
RewriteRule page2.htm archives/7-blehbleh.html [R=301,L]
...
This assumes that Serendipity is installed in the root directory. It's possible the files will be found if they exist; you might want to rename or remove them. If you want Page1.HTM to find the file as well, change "[R=301,L]" to "[R=301,L,NC]".

If Serendipity is in a directory other than root, you'll have to add that block to the root .htaccess and add the s9y directory before "archives/".

Finally, some folks type in .html from habit; if you want to redirect both .htm and .html, change "page1.htm" to "page1.html?".

Hope I got it right this time.
Judebert
---
Website | Wishlist | PayPal
Post Reply