Moved blog to new directory

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
kharri1073
Regular
Posts: 15
Joined: Tue May 09, 2006 6:01 pm
Contact:

Moved blog to new directory

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Moved blog to new directory

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
kharri1073
Regular
Posts: 15
Joined: Tue May 09, 2006 6:01 pm
Contact:

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply