Jump to content

301 redirect infinite loop


jwwceo

Recommended Posts

hello,

 

google is indexing a page in my site which is a nonsense page, with a blank GET value like this:

 

home.php?category=

 

where Category is NULL. It just shows my home page without doing anything.

 

I want to try and redirect this to my home page, to give the home page the most SEO power, so I wrote the following script:

 

if ($category == '0' || $category == NULL){
unset($category);

header("HTTP/1.1 301 Moved Permanently");
header("Location: home.php");

 

But this just sets my home page into an infinite loop, where the page trying to be displayed is home.php?category=

 

Any ideas why that GET value is being preserved.

 

James

Link to comment
https://forums.phpfreaks.com/topic/186645-301-redirect-infinite-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.