| |||||||
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 ...
![]() |
| | Thread Tools |
| | #1 |
| BANNED Join Date: Jan 2009
Posts: 4,429
![]() ![]() ![]() ![]() ![]() ![]() | www to non-www using PHPHey 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" ); ?> So, could help me and tell me the correct code to use for both problems above, please? Thanks! |
|
| | #2 |
| iPod 20gb | 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 ? |
|
| | #3 | |
| BANNED Join Date: Jan 2009
Posts: 4,429
![]() ![]() ![]() ![]() ![]() ![]() | Quote:
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. | |
|
| | #4 |
| iPod 20gb | |
|
![]() |
| Thread Tools | |
| |