0

I have a Magento store but for some reason the generated URL rewrites for several products seem to incorrectly redirect to the category base URL instead of the product itself.

An example of a URL in question would be as follows:

http://example.com/q-connect-floor-standing-fan-410mm-16in.html

this URL redirects to its base category page:

/office-supplies/

Using the program web-sniffer I can see that the URL's in question have the following 301 redirects:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://example.com/office-supplies/">here</a>.</p>
</body></html>

Strangely however when I look at these products up in the Magento URL Rewrite admin they are set up normally without any sign of a 301 redirect. The true product links do work so I know there is nothing wrong with the product itself.

Anyone ever encountered something similar to this or know what is going on?

Thanks.

  • Run the following query: UPDATE core_url_rewrite SET options='R' WHERE options='RP'. Optionally limit by a specific request_path. Then flush cache. Now get the url again. If it changed to 302, then Magento really is doing it. If not, then look outside your webserver. Htaccess, loadbalancer, whatever's in your stack that touches URLs. To revert the change simply swap the option values for the SET and where parts in the query and flush cache again. – Melvyn Jun 5 '15 at 7:40
1

This page looks like a apache 301 page, rather than a magento one, therefore I assume the httpd is doing the redirect and not magento.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.