HOME       >>       Programming

Php Rediret Script


Jesse

Ok, what I am trying to do is this. Re-direct a domain name called: avalon.asn.au to preschool.stmarksavalon.org.au

 

I have created a script that will re-direct within the a folder. However, the avalon.asn.au and stmarksavalon.org.au are PARKED Domains.

 

Any ideas on how to create this PHP Redirect Script please?


sonesay

I think this code will do it

<?phpheader("location: newlocationname.php");?>


Jesse

Yeah that is the PHP Script I already have. But the issue is it needs to go from one parked domain to another sub-domain on another parked domain and the avalon.asn.au does NOT have its own folder to insert the current PHP Script that I have.

The actual working code I have is:

<?$URL="http://preschool.avalon.anglican.asn.au";header ("Location: $URL");?>


However there needs to be the link in thee from avalon.asn.au to re-direct to the link in the code above.

jlhaslip

Change the Nameservers on the Domain you need to be re-directed to the other Parked Domain.


Jesse

Name Servers are Re-Directed.


jlhaslip

Wait a minute... the avalon.asn.au is a Subdomain, so the nameservers can't be changed.Could you create a folder for avalon.asn.au and add the index file with the redirect to that folder??? Creating the subdomain creates a folder for the subdomain, does it not? It does in Cpanel.


jlhaslip

Or un-park that Domain and create an Add-on Domain at the second location.


Jesse

No the avalon.asn.au is not the sub-domain (it is a parked domain) the sub-domain is preschool.stmarksavalon.org.au


Jesse

That can't be done. The web host is the Anglican Church, the Minister I know is wanting me to help him with this but because of the limited access in the cPanel and so on, its making it hard and having to write a full php re-direction instead of just the simple re-direction which I already had made.


jlhaslip

You'll need to modify the Index page of the receiving Domain to write the redierct for you.Need the php script for that? I have a similar script handy.


Jesse

Yes that would be great if you do


jlhaslip

Try this:

<?phpif ($_SERVER[HTTP_HOST] == 'avalon.asn.au') { // avalon.asn.au header('Location: http://preschool.stmarksavalon.org.au');}?>

*EDIT*

I guess it didn't work, so I suggest you ask the nice Minister to allow you to add-on the Domain to the right place. That would be the best solution (overall). Might not be the simplest, but Google and the Bots might not like the double re-direct, first to the Parked Domain and then to the sub-domain. It would be best to get better SEO and to shorten the download time, etc.

Jesse

I just ended up telling him to spend the extra few dollars a month and host the pre-school on a seperate account. Which after a LOT of talking he finally agreed. Some people just have no idea what they are asking of people, it is so annoying at times.



VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.