eXceem

Go Back   eXceem > Off Topic > Technical Help

Claim your amazing £1,000 slots booster bonus now!


www to non-www using PHP

This is a discussion on www to non-www using PHP within the Technical Help forums, part of the Off Topic category; Hey guys! I need some help setting up a PHP script to redirect my homepage from www to non-www. I'm ...

Reply
 
Thread Tools
Old 27-06-10, 12:09 PM   #1
BANNED
 
Join Date: Jan 2009
Posts: 4,429
Djoscar has much to be proud ofDjoscar has much to be proud ofDjoscar has much to be proud ofDjoscar has much to be proud ofDjoscar has much to be proud ofDjoscar has much to be proud of

www to non-www using PHP


Hey guys!

I need some help setting up a PHP script to redirect my homepage from www to non-www.

I'm on Windows server, so I can't use .htaccess and it's a shared hosting so I can't use IIS.

So, i guess the only thing left for me to use is PHP redirect, right?

Should the code be something like this?
Code:
<?
Header( "HTTP/1.1 301 Moved Permanently" ); 
Header( "Location: http://new-url.com" ); 
?>
Also, when I put index.php in my root folder, and go to freeiphone.co.uk it shows a 404 error. I guess i need to add something to the code to tell the browser that index.php is the default homepage file?

So, could help me and tell me the correct code to use for both problems above, please?

Thanks!
 
Reply With Quote
Old 27-06-10, 12:16 PM   #2
iPod 20gb
 
Zazizizou's Avatar
 
Join Date: Aug 2009
Posts: 686
Zazizizou has a spectacular aura about
Send a message via MSN to Zazizizou Send a message via Skype™ to Zazizizou Send a message via twitter to Zazizizou
You can put an actual page in your non-www site that shows the new link (manual redirecting).

I don't know how the code should be but aren't there a redirecting function in html/java code ?
 
Reply With Quote
Old 27-06-10, 12:18 PM   #3
BANNED
 
Join Date: Jan 2009
Posts: 4,429
Djoscar has much to be proud ofDjoscar has much to be proud ofDjoscar has much to be proud ofDjoscar has much to be proud ofDjoscar has much to be proud ofDjoscar has much to be proud of
Quote:
Originally Posted by Zazizizou View Post
You can put an actual page in your non-www site that shows the new link (manual redirecting).

I don't know how the code should be but aren't there a redirecting function in html/java code ?
Sorry, I don't get what you mean by the first sentence..

And the html redirects like meta redirect are 302 temporary redirects and are bad for SEO I think. And I don't think they would work with redirecting www to non-www.
 
Reply With Quote
Old 27-06-10, 08:00 PM   #4
iPod 20gb
 
Zazizizou's Avatar
 
Join Date: Aug 2009
Posts: 686
Zazizizou has a spectacular aura about
Send a message via MSN to Zazizizou Send a message via Skype™ to Zazizizou Send a message via twitter to Zazizizou
Quote:
Originally Posted by Djoscar View Post
Sorry, I don't get what you mean by the first sentence..

And the html redirects like meta redirect are 302 temporary redirects and are bad for SEO I think. And I don't think they would work with redirecting www to non-www.
Never mind. Sorry.
 
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off





All times are GMT. The time now is 08:53 PM.
All trademarks and copyrights held by respective owners. Forum posts are owned by the poster.

Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO
no new posts