Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 ASP (Windows server) versions
 SEO URLs proddetail Handling
Author « Topic »  

Dermontti
Advanced Member

USA
161 Posts

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/" />

Vince
Administrator

42685 Posts

Posted - 07/26/2024 :  09:05:26  
Hi Dermontti
quote:
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.
How about checking to see if you have a physical file or not with this?
<add input="{REQUEST_FILENAME}" matchType="isFile" negate="true">
quote:
In addition, the result of the condition evaluation can be negated by using the negate attribute. This can be used to specify a condition that checks if the requested URL is NOT a file, as in the following example:

Full details here...
https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-configuration-reference

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

Dermontti
Advanced Member

USA
161 Posts

Posted - 07/29/2024 :  04:46:35  
Thanks.


Do you think the rules will interfere with any part of the ECT platform?

joetuesday
Advanced Member

183 Posts

Pre-sales questions only
(More Details...)

Posted - 07/29/2024 :  16:22:19  
Hello - I would make a test site one level down from your site in the domain and edit robots.txt to no spide the test folder - then run screaming frog on the folder - apply the url rewrites and run it again and see what happens.

Joe

Dermontti
Advanced Member

USA
161 Posts

Posted - 07/30/2024 :  04:39:15  
Hello Joe,

subdirectory test sites are bad practice and a thing of the past. We had that a while back and Google and Bing were indexing the pages. I can still see bingbot going and trying to find them and getting 404s.

The rewriting also changes the IIS router and is handled through the web.config file which can only be in the root directory. I don't think you can do this type of testing in prod.

We have an IP whitelist separate domain that only allows or IP and I do all initial testing in a local test environment.

I am still researching the best way to set this up.
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000