This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Webmaster forum > April 2006 > .htaccess woes





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author .htaccess woes
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


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews