1

I have a unique situation being thrown at me here.

I have a product which in every way is a standard Magento catalog product. Has an entity id, sku, attributes the whole works.

None of this can change.

However, the powers that be would like any users hitting this product's request_path to go to another url, not the standard catalog/product/view target_path.

I've tried accomplishing this via the Url Rewrite Management panel, but Magento will not allow it since (if I select Product Rewrite) it locks the catalog/product/view in the target_path input field, or (if I select Custom) it will throw a duplicate record error if I try to direct the current request_path to the new target_path.

Is there any way to specify a custom target_path for a catalog product that does not follow the standard catalog/product/view/id/# format, or are they asking to force a square peg in a round hole?

To be clear, what we have is:

id_path        request_path       target_path
product/12345  this-product.html  catalog/product/view/id/12345

and what we want to accomplish is:

id_path        request_path       target_path
product/12345  this-product.html  custom/url/path

Editing the record directly, as I understand it, is pointless, since the url indexing will just overwrite the custom target_path. Or am I wrong?

0

It might not be the cleanest way, but this will work regardless of your url indexing. Add this code to your Design > Custom Layout Update area on the product and update URL per product.

<reference name="head">
    <block type="core/text" name="your.block.name">
        <action method="setText">
            <text><![CDATA[<script type="text/javascript">location.replace("https://www.WEBSITE.com/CUSTOM-REDIRECT");</script>]]></text>
        </action>
    </block>
</reference>

It's not really recommended, but it works

  • Certainly not a preferable solution, but if it must happen it'll be nice to try this snippet. Thank you. – Jonathan Eltgroth Jul 22 '17 at 7:28

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.