Page 1 of 1

301 Header help needed - it's not redirecting the browser

Posted: Thu Jul 09, 2015 9:29 am
by simonmlewis

Code: Select all

header("Location: http://site.local/subcateg/$rowredir->catid/$categreplace/$rowredir->subid/$subcategreplace/",TRUE,301);
If someone finds a product that is paused from consumer view, I want to redirect them to the next available subcategory.

I have captured both the prodID and subID, and now wanting to 301 them to the subID. The above isn't working. All that happens is they are taken to the product page and shown a message (from the product.inc file) to say it is no longer available.

I don't get any errors, but they aren't taken away either.

Re: 301 Header help needed - it's not redirecting the browse

Posted: Thu Jul 09, 2015 9:39 am
by Celauran
You've checked that the redirect URL is correct? Checked that the header call comes before all browser output?

Re: 301 Header help needed - it's not redirecting the browse

Posted: Thu Jul 09, 2015 10:20 am
by simonmlewis
My bad - the bloomin query to generate it wasn't pulling the data up correct.