Hello
I hope you can help me please... having an absolute nightmare.
I have a strange problem with htaccess and the rewrite engine.
We recently moved over from a Zeus webserver to Apache, so this is all totally confusing!
We have many domains, but for this sample I have included two. My domain paths are:
/home/me/htdocs/www.domain.net/
and
/home/me/htdocs/www.domain2.co.uk/
My main .htaccess (the paste below) is located at /home/me/htdocs/.htaccess
The problem I'm getting is that if a URL is loaded such as http://domain.net/about it gets rewrote to http://domain.net/www.domain.net/about
In addition, I am able to call another domain from the first. For example, if I was on www.domain.net I could load www.domain2.co.uk via http://www.domain.net/www.domain2.co.uk
The rules I have:
# Error handling
ErrorDocument 404 /404.php
# Rewrite engine
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.net$ [or]
RewriteCond %{HTTP_HOST} ^domain\.net$
RewriteRule ^(.*)$ www.domain.net/$1 [L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain2\.co.uk$ [or]
RewriteCond %{HTTP_HOST} ^domain2\.co.uk$
RewriteRule ^(.*)$ www.domain2.co.uk/$1 [L]
I then have another .htaccess in the "www.domain.net" folder that says
RewriteEngine off
Any ideas what I've missed? I've been trying to sort this out for days 🙁