I have a web application that has "pretty urls". The .htaccess
file there looks like this:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([a-z0-9]+)(/)?([a-z0-9]+)?$ /home/user/domains/domain1.com/public_html/sites/index.php?site=$1&page=$3 [QSA]
So when I enter domain1.com/site/page
it actually shows me domain1.com/index.php?site=site&page=page
. This works fine.
BUT
I have another domain, let's say domain2.com
. I have it in the same account in the DirectAdmin. When I enter the ftp account and go to domains/
I see there both domain1.com
and domain2.com
.
I want to force domain2.co.il
to show domain1.com/index.php?site=domain2
I placed the same .htaccess
file (with a minor change of the site
parameter) in the public_html
of domain2.com
. The result is 404 error.
So the question is: How to make it work the way I want?
I also read the following posts, but I can't seem to find use out of them. Maybe I just don't understand how: