Page 1 of 1

Moved blog to new directory

Posted: Mon Jun 16, 2008 10:54 pm
by kharri1073
I used to have my blog in the root of my webhosting. I had to move the blog out of the root so I could use mod_rewrite for other programs, so i moved it to /blog/.

I tried to 301 redirect and 410 gone most of my pages since I basically restarted my blog from scratch only recreating a few posts from my old blog but the 301s and the 410s did not work.

I first tried to accomplish this from the root .htaccess file but it didn't give the correct header.

I used the following in my .htaccess.

Code: Select all

Redirect 410 /index.php?/archives/2005/12/C2.html
Redirect 301 http://www.roffle.us/index.php?/archives/69-Google-Web-Server-GWS2.1.html http://roffle.us/blog/archives/2-Google-Web-Server-GWS2.1.html
The pages that i want redirected either produce 200 found or 404 errors. The first line produces 200 and the second line produces a 404.

My root .htaccess file contains...

Code: Select all

DirectoryIndex index.php index.html index.htm
Redirect 302 /index.php http://roffle.us/blog/
... and my serendipity .htaccess file contains a default serendipity .htaccess.

Any ideas how I can straighten out my redirection mess?

Re: Moved blog to new directory

Posted: Tue Jun 17, 2008 10:34 am
by garvinhicking
Hi!

Sadly I've never worked with that "Redirect" command you use, I always used RewriteRule methods for mod_rewrite.

When I use LiveHTTP Headers to check your forward, then I get forwarded to:

Code: Select all

Location: http://roffle.us/blog/?/archives/69-Google-Web-Server-GWS2.1.html
That's a bad URL, notice the "/?/" in the middle? I wouldn't know where this comes from?!

Regards,
Garvin

Posted: Tue Jun 17, 2008 6:07 pm
by kharri1073
Yea, I'm trying anything in my .htaccess.

Do you have a better idea of how to implement the redirect? I'll try anything.

Posted: Tue Jun 17, 2008 7:50 pm
by garvinhicking
Hi!

Try something like this:

http://board.s9y.org/viewtopic.php?t=12 ... terule+301

Code: Select all

RewriteRule ^/index.php?/archives/69-Google-Web-Server-GWS2.1.html$ http://roffle.us/blog/archives/2-Google-Web-Server-GWS2.1.html
 [R=301,L] 
HTH,
Garvin