Posted - 07/26/2024 : 08:11:16
Hello,
I am in the development phase for changing over to SEO URLs (parameterization of URL) and made a customization for the proddetail (product endpoint).
I did this because the product rewrite rule in IIS was being applied to every page across the website and missing a single file extension from the exclusion list could cause breakage and it interfered with other parameterized URLs.
This code does https://domain/product/productName
This seems to be working fine in the test environment, but do you see any potential issues with the below code breaking other functionality?
web.config: <rule name="Categories Match" stopProcessing="true"> <match url="^category/([^/]*)/?$" /> <action type="Rewrite" url="categories.asp?cat={UrlEncode:{R:1}}" /> </rule> <rule name="Products Match" stopProcessing="true"> <match url="^products/([^/]*)/?$" /> <action type="Rewrite" url="products.asp?cat={UrlEncode:{R:1}}" /> </rule> <rule name="Product Match" stopProcessing="true"> <match url="^product/([^/]+)/?$" /> <action type="Rewrite" url="proddetail.asp?prod={UrlEncode:{R:1}}" /> </rule>
incfunctions: function getdetailsurl(gdid, gdstatic, byval gdname, gdurl, gdqs, gdpathtohere) gdname = IIfVr(gdurl <> "", gdurl, gdname & "") if seodetailurls then getdetailsurl = IIfVr(instr(gdname, "://") > 0, gdname, gdpathtohere & "product/" & rawurlencode(replace(gdname, " ", detlinkspacechar)) & IIfVs(gdqs <> "", "?" & gdqs)) elseif gdurl <> "" then getdetailsurl = gdurl & IIfVs(gdqs <> "", "?" & gdqs) elseif cint(gdstatic) <> 0 then getdetailsurl = "product/" & cleanforurl(gdname) & extension & IIfVs(gdqs <> "", "?" & gdqs) else getdetailsurl = "product/proddetail" & extension & "?prod=" & urlencode(IIfVr(usepnamefordetaillinks, replace(gdname, " ", detlinkspacechar), gdid)) & IIfVs(gdqs <> "", "&" & gdqs) end if end function
proddetail: <base href="http<% if request.servervariables("HTTPS")="on" then response.write "s"%>://LOCAL_IP/" />
|