Forum Moderators: phranque
I have three Websites hosted by my ISP each each stored in it's own subdirectory off the root. I recently had to add an htaccess file to this root directory to redirect users from an old website address to a new domain I had purchased (again hosted in a sub-directory).
However this htaccess file is now applying site-wide and across all aliases meaning all three of my sites now point to just one site
As I understand htaccess files cascade downwards, so that if I have a .htaccess file in my root directory, /,
and another in a sub-directory called /Wright, then when a file is requested from the /Wright directory Apache will merge the two files and use all the directives.
Is there any way I can stop this behaviour - I have a 301 redirect in my root directory and I don’t want it to apply to the /Wright sub-directory. I have tried unsuccessfully putting a 301 redirect in the /Wright sub-directory to override the root but this has not been successful.
I tried another .htaccess file in one of the sub-directories housing one of the affected sites, but all that happened when I tried visiting the affected url was the browser hung. It kept trying to open the page but eventually timed out.
Also (just to complicate things) I should add that the document root of my old Website and the overall root were the same.
Thanks in hopeful anticipation folks
My overall root directory is /htdocs
However this was also the site root for my old Website namely http://www.danny.example.co.uk
I have now moved this site’s contents to a new sub directory called danny i.e. /htdocs/danny and my new domain of http://www.tree.example.co.uk points to this.
I have a .htacess file with the contents below successfully redirecting from http://www.danny.example.co.uk to http://www.tree.example.co.uk
redirect 301 /index.htm http://www.tree.example.co.uk/
My problem is that two further websites of mine each hosted in their own sub-directory i.e. /htdocs/right and /htdocs/nick have both started redirecting to http://www.tree.example.co.uk since the working .htacess file on www.tree.example.co.uk was implemented.
Thanks
[edited by: jdMorgan at 2:12 pm (utc) on Aug. 15, 2005]
[edit reason] Removed specifics per TOS. De-linked. [/edit]
Start with the reference documents cited in our forum charter [webmasterworld.com]. Reading the charter will also help you to get the most out of this forum. There are also two [webmasterworld.com] posts [webmasterworld.com] in the library [webmasterworld.com] that will help you get started.
Jim