Forum Moderators: phranque

Message Too Old, No Replies

Domain landing issue (htaccess)

         

Sark

6:09 pm on Jan 12, 2006 (gmt 0)

10+ Year Member



Hi guys i have a problem but i can't figured it out (have used google but no succes)

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

physics

6:12 pm on Jan 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you on Apache or IIS.
If you're on a shared server you should ask your host how to have two different domains point to different file areas, no?

Sark

6:31 pm on Jan 12, 2006 (gmt 0)

10+ Year Member



i'm running apache, but the problem is that i can't edit my http.conf because it is a shared server (more people running on it i got a space on it). But a friend of mine told me it could be done by .htaccess only didn't know how so that is why i really need your help.

Thnx

Sark

3:28 pm on Jan 15, 2006 (gmt 0)

10+ Year Member



Anyone.. please

physics

6:00 am on Jan 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Look into using mod rewrite in .htaccess
The commands are pretty much the same as you would do them in httpd.conf
Like:

RewriteEngine On
...(code to do what you want here)...

See:
[httpd.apache.org...]

inbound

6:27 am on Jan 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have tried to get .htaccess to work without any success it could come down to the way in ahich domain2 is set up.

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 ;)