| A Wieser 2006-04-28, 7:06 pm |
| Hi,
I have a domain www.example.com where I have the following in my .htaccess
redirect 302 /index.htm http://www.example.com/arbitrary/subdir/index.htm
What I was trying to do is redirect every request for www.example.com/,
www.example.com or www.example.com/index.htm to the latest page. My
directory structure on my website is setup so that the domain points to the
root of the visible tree, and everything seemed to be working hunky dory.
Now I have created another domain, that has its root as a sub folder within
the original hierarchy. I know I can use .htaccess to make fishing requests
for
http://www.example.com/secondexampledir be routed to the correct domain
with:
redirect 301 /secondexampledir http://www.secondexample.com
However, any queries for my second site, say
www.secondexample.com now get redirected to the original
http://www.example.com/arbitrary/subdir/index.htm
I tried various things after removing the redirect 302 shown above, but none
of them worked, for instance:
RewriteCond %{REQUEST_FILENAME} www.example.com/index.htm [NC]
RewriteRule \.*$ http://www.example.com/arbitrary/subdir/index.htm [R=302,L]
but no matter what I do, I can't get it to work.
Any suggestions other than creating subdirectories for each individual site,
with its own htaccess?
--
Anthony Wieser
Wieser Software Ltd
Analyze your web logs and more with TopDrop
www.wieser-software.com/topdrop
|