Forum Moderators: phranque

Message Too Old, No Replies

moved from parent domain to domain in sub folder

         

bendee

6:49 pm on Aug 11, 2004 (gmt 0)

10+ Year Member



Apologies if this has been asked many times, but I am hosting several domains on one server, and the secondary domains exist in subfolders of their parent domain.

so the structure is thus:

/htdocs/parentdomain - parentdomain.com
/htdocs/parentdomain/anotherdomain - anotherdomain.com

I have some traffic coming in to files that used to be on parentdomain.com in the root, and have moved them to the anotherdomain folder.

When I try to redirect the traffic in .htaccess, it gets caught in a redirect loop. However, redirecting the old pages to a new domain on another server works fine.

Here's the relevant code:

RewriteEngine on
Redirect 301 /widget-feature.html [anotherdomain.com...]

Any help would be appreciated.
Thanks
Ben Davis

jdMorgan

9:03 pm on Aug 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ben,

Yes, you'll need to use mod_rewrite to do this in order to prevent the loop. Simply add a RewriteCond to your RewriteRule that blocks the redirect if the subfolder path is requested. You can do a site search of WebmasterWorld with the words "subdomain subfolder rewriterule [google.com]" to turn up examples.

Jim