Forum Moderators: phranque
I have a server (shared) with the a domainname, lets say it is "domain1.com".
At the this server i have another domain parked, lets name it "domain2.com"
Now when i type in domain1.com i'll land at domain1.com/index1.php
When i type in domain2.com i'll land at domain1.com/index1.com
What try to reach is that when i type in:
domain2.com i'll get to see domain2.com/index2.php
Overview
domain1.com = domain1.com/index1.php
domain2.com = domain2.com/index2.php
I have read some thing about .htaccess but i can't seem to get it working. Please help me out
Thnx in advance
RewriteEngine On
...(code to do what you want here)...
There is ecvery chance that domain2 is appearing to be domain1, this can happen when a poor version of domain forwarding is in place. A dead giveaway for this is if domain2 is all that shows in the address bar as you traverse the site.
To be 100% sure I would use phpinfo. Here's what to do:
Make a file called something.php with just the following in it.
<?php
phpinfo();
?>
Upload it to your site and then visit it by going to www.domain1.com/something.php
Go down to the bottom of the page and locate the section called PHP Variables.
Look for _SERVER["HTTP_HOST"] - this is the domain that the server has provided the page from, that should be domain1 in that case.
Now do the same for domain2, if domain2 shows up then .htaccess should work. If not .htaccess will be of no use.
There are plenty of .htaccess tutorials around so I'll leave the rest to you ;)