Jump to content

If (This_domain) { //this page } else { //this other page }


derrick1123

Recommended Posts

I didn't know how to do this, or if this was even possible. I have to domains going to the same IP.

I need to get Domain 1 to go to Folder 1, but if someone goes to Domain 2 then I want them to go to Folder 2.

 

<?php

$domain['sw337'] = "sw337.mydomain..."; //domain 1
$domain['sfuk'] = "sfuk.mydomain..."; //domain 2

if ($domain['sw337']) {
echo "Go <a href=" . $domain['sw337'] . "/en'>here</a>"; //domain 1
} else {
echo "Go <a href=". $domain['sfuk'] . "/sfuk'>here</a>"; //domain 2
}
?>

Windows VISTA

 

I have been trying to get it to work with .htaccess... This is what I have so far:

Options +FollowSymlinks
RewriteEngine ON

RewriteCond %{HTTP_HOST}!^sw337\.servegame\.com
RewriteRule^(.*)$ http://sw337.servegame.com/en

RewriteCond %{HTTP_HOST}!^sfuk\.servegame\.com
RewriteRule^(.*)$ http://sfuk.servegame.com/sfuk

I just asked the same thing for my Server, only it is a win 2000 server and it works on there

 

http://www.phpfreaks.com/forums/index.php/topic,199919.0.html

 

There is a host file here

 

\Windows\system32\drivers\etc\

 

And you need to change the vhosts in apache.  i gave my config files in the thread so if you need help, let me know.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.