Header
Posted: Tue Feb 21, 2012 6:08 am
Hi guys,
what I want to achieve is:
Put 301 redirect from all pages of http://xxxx.com/ domain to corresponding pages of http://www.xxxxx.com/.
but I am getting this error in the page:
Youssef
what I want to achieve is:
Put 301 redirect from all pages of http://xxxx.com/ domain to corresponding pages of http://www.xxxxx.com/.
Code: Select all
<?php
function currentPageURL() {
$curpageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$curpageURL.= "s";}
$curpageURL.= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$curpageURL.= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$curpageURL.= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $curpageURL;
}
$FullUrl = currentPageURL();
if ($FullUrl = "http://xxx.com/")
{
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.xxxx.com/" );
}
?>
This web page has a redirect loop
The web page at http://www.xxx.com/ has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
Here are some suggestions:
Reload this web page later.
Learn more about this problem.
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
Youssef