Files moved to a subdomain - how to redirect?

Using a single web hosting account to host multiple sites

Files moved to a subdomain - how to redirect?

Postby Tygger2512 » Thu Sep 09, 2004 6:22 am

Hello,

I have a weblog which was located at:

http://as-if-by-magic.com/weblog/

I've now moved it to http://blog.as-if-by-magic.com/ and I'm getting 404 errors from search engine results looking for files at the old location.

I want to redirect all requests for http://as-if-by-magic.com/weblog/$1 (the hierarchy after /weblog/ is duplicated in the subdomain) to http://blog.as-if-by-magic.com/$1

Please help me specify the correct rules in .htaccess. I would also like to send a 301 so that the search engines will update the location.

Thanks for your help,
Andy Mason
Tygger2512
 
Posts: 6
Joined: Thu Sep 09, 2004 6:16 am
Location: Pittsburg, KS

Postby Guest » Thu Sep 09, 2004 2:20 pm

I've resolved my problem by putting the following rule in a .htaccess file in the subdirectory http://as-if-by-magic.com/weblog/
Code: Select all
RewriteEngine on
RewriteRule ^(.*)$  http://blog.as-if-by-magic.com/$1 [R=301,L]

Hope this helps anyone else struggling with arcane mod_rewrite syntax who has the same problem as me.
Guest
 

Postby Tygger2512 » Thu Sep 09, 2004 2:22 pm

Dang, I wasn't logged in - the response above was from me.
Tygger2512
 
Posts: 6
Joined: Thu Sep 09, 2004 6:16 am
Location: Pittsburg, KS


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 29 guests

cron