FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


A script to...





DarkCore
Hello all PHP coders. I was wondering if any one knows how to write a script that when you go to the site with a domain like darkcore.co.nr it says please go to the site using this domain. But when they go with the right domain darkcore.uni.cc (just an example) it dosn't show that. If anyone could help that would be great.
hexkid
DarkCore wrote:
Hello all PHP coders. I was wondering if any one knows how to write a script that when you go to the site with a domain like darkcore.co.nr it says please go to the site using this domain. But when they go with the right domain darkcore.uni.cc (just an example) it dosn't show that. If anyone could help that would be great.


If darkcore.co.nr and darkcore.uni.cc resolve to the same machine, and that machine serves the same files for the different domains (check Apache [or whatever is your web server]), you have to differentiate with PHP (* see below). If the domains resolve to different machines or different files, simply set darkcore.co.nr to display the darkcore.uni.cc domain, and darkcore.uni.cc to display your site content.

Code:
<?php
// not tested. You may have to use a different index for $_SERVER
if ($_SERVER['SERVER_NAME'] == 'darkcore.co.nr') {
  echo 'Please use the "darkcore.uni.cc" domain.';
} else {
  echo 'site contents';
}
?>
loyal
i do not quite understand what you mean.

if you want the old address to automatically redirect in 5 seconds put this in your script:

<html>
<head>
<meta http-equiv="refresh" content="5;url=http://darkcore.uni.cc">
</head>
<body>
This page will redirect from darkcore.co.nr to darkcore.uni.cc in 5 seconds.
</body>
</html>

It does not even have to be php. That is html redirect.
kv
Put the refresh html by loyal into a file, let us say redirect.html in your darkcore.uni.cc host. Then set your .co.nr account to point to http://darkcore.uni.cc/redirect.html. Rest of the things are automatically taken care.
Related topics
Which is your favourite weblog Script?
Chat script
Script Upload (obiefileman)
script backup database
Script run background
Can someone make me a php script?
target = _parent redirect script?
Bookmark Script:
Some Script Show
Image transparency script
A script for Loading
Set As Home Page Script (IE Only)
Where I can find a 3d chat script
Un script installer? laissez faire frihost!
Need a script - navigation
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.