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
}
?>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

vhosts is located in

Apache\config\extra\httpd-vhosts.conf

 

This is the path to my hosts file.

C:\Windows\System32\drivers\etc\hosts

 

this is on a Vista laptop, so you may have to unhide all files and folders, and system folders, not sure though.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.