Created
November 21, 2016 16:52
-
-
Save bheyde/d7717d5c26058ad8fb01791853ac6957 to your computer and use it in GitHub Desktop.
Miva 301 Redirect to Canonical
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mvt:comment>Build l.uri structure with required data</mvt:comment> | |
<mvt:assign name="l.uri:store_id" value="g.Store:id" /> | |
<mvt:assign name="l.uri:screen" value="''" /> | |
<mvt:assign name="l.uri:page_id" value="0" /> | |
<mvt:assign name="l.uri:cat_id" value="0" /> | |
<mvt:assign name="l.uri:product_id" value="l.settings:product:id" /> | |
<mvt:comment>Load canonical URI for this product</mvt:comment> | |
<mvt:do file="g.Module_Feature_URI_DB" name="l.has_uri" value="URI_Load_Item_Canonical( l.uri, l.settings:product:uri )" /> | |
<mvt:if expr="l.has_uri"> | |
<mvt:assign name="l.settings:product:uri:redirect_to" value="l.settings:product:uri:uri" /> | |
<mvt:if expr="'/mm5/merchant.mvc' CIN s.request_uri EQ 1"> | |
<!-- REDIRECT! --> | |
<mvt:assign name="l.header" value="miva_output_header( 'Status', '301 Moved Permanently' )" /> | |
<mvt:assign name="l.header" value="miva_output_header( 'Location', l.settings:product:uri:redirect_to )" /> | |
</mvt:if> | |
</mvt:if> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment