scarhand Posted November 18, 2010 Share Posted November 18, 2010 how would i go about doing this? lets say i want to use different domains i.e.: mysite.com mycoolsite.com but i want them to both use the same php script i.e.: myscript.com/site.php?domain=mysite.com each site will show different content depending on the domain $_GET variable... can anyone help me with this? Link to comment https://forums.phpfreaks.com/topic/219106-pointing-domains-to-a-php-script/ Share on other sites More sharing options...
seanlim Posted November 18, 2010 Share Posted November 18, 2010 i'm guessing the php script on mysite.com and mycoolsite.com will just have to fopen("http://myscript.com/site.php?domain=...") or am i missing something? Link to comment https://forums.phpfreaks.com/topic/219106-pointing-domains-to-a-php-script/#findComment-1136204 Share on other sites More sharing options...
kahodges Posted November 18, 2010 Share Posted November 18, 2010 You could use a .htacess file to redirect your domain to any script located on the same domain, or a different domain. Link to comment https://forums.phpfreaks.com/topic/219106-pointing-domains-to-a-php-script/#findComment-1136213 Share on other sites More sharing options...
scarhand Posted November 18, 2010 Author Share Posted November 18, 2010 the problem is i want to have it so that: mysite.com/subpage would point to: myscript.com/?domain=mysite.com&page=subpage Link to comment https://forums.phpfreaks.com/topic/219106-pointing-domains-to-a-php-script/#findComment-1136337 Share on other sites More sharing options...
seanlim Posted November 19, 2010 Share Posted November 19, 2010 Never tried it before, but mod_rewrite might work? I think there's a proxy option too so mysite.com can act as a proxy to your second site. Then use RewriteRule to format the URL whichever way you want... Link to comment https://forums.phpfreaks.com/topic/219106-pointing-domains-to-a-php-script/#findComment-1136451 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.