Posted - 10/28/2017 : 09:33:04
Hi Andy, from the info link https://www.ecommercetemplates.com/help/search-engine-friendly.asp#seourl Sinbad provided your documentation says:
Note: I am very familiar with using web.config for 301 redirects so that is what I would focus on using and wondered if that method would throw errors if using hyphens and/or quotes. Sounds like quotes is a problem but don't know why hyphens would be a problem. I have LOTS of hyphens in my product names, but not may quotes.
*** web.config method
This is probably the simplest way of doing things. We have prepared a file called web.config that needs uploading to the root of your store. First of all you need to check if there is already a file called web.config on the server. If that file isn't already present download the config.zip file, unzip it and upload web.config to the store root.
If there is already a web.config file you will need to merge the contents of the existing file with the one available for download. Open the existing web.config file in a text editor. Download the config.zip file, unzip it and also open that in a text editor.
If for example the existing web.config file contains the following
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <asp scriptErrorSentToBrowser="true" /> </system.webServer> <system.web> <customErrors mode="Off" /> <compilation debug="true" /> </system.web> </configuration>
You would add the Rewrite code so you have something like this
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <asp scriptErrorSentToBrowser="true" /> </system.webServer> <system.web> <customErrors mode="Off" /> <compilation debug="true" /> <rewrite> <rules> <rule name="Categories Match" stopProcessing="true"> <match url="^category/([^/]*)/?$" /> <action type="Rewrite" url="categories.asp?cat={UrlEncode:{R:1}}" /> </rule> <rule name="Product Match" stopProcessing="true"> <match url="^products/([^/]*)/?$" /> <action type="Rewrite" url="products.asp?cat={UrlEncode:{R:1}}" /> </rule> <rule name="All Manufacturer Match" stopProcessing="true"> <match url="^manufacturer/?$" /> <action type="Rewrite" url="categories.asp?man=all" /> </rule> <rule name="Manufacturer Match" stopProcessing="true"> <match url="^manufacturer/(.*)$" /> <conditions> <add input="{UNENCODED_URL}" pattern="manufacturer/[^/]*" /> </conditions> <action type="Rewrite" url="products.asp?man={UrlEncode:{R:1}}" /> </rule> <rule name="Product Detail Page Match" stopProcessing="true"> <match url="^([^/]+)/?$" /> <conditions> <add input="{URL}" pattern="\.asp" negate="true" /> <add input="{URL}" pattern="\.css" negate="true" /> <add input="{URL}" pattern="\.gif" negate="true" /> <add input="{URL}" pattern="\.jpg" negate="true" /> <add input="{URL}" pattern="\.js" negate="true" /> <add input="{URL}" pattern="\.png" negate="true" /> <add input="{UNENCODED_URL}" pattern="[^/]+" /> </conditions> <action type="Rewrite" url="proddetail.asp?prod={UrlEncode:{R:1}}" /> </rule> </rules> </rewrite> </system.web> </configuration>
Save that file and upload it again to the store root.
You can now test the extension-less URLs, making sure you have also added the new paramters listed above to vsadmin/includes.asp. If you have tested, made sure the file changes are correct and it's not working for you, there is anoher method available but this will require the help of your host.
*** Question: I have lots of - (hyphens) in my product names. Why will that cause a problem?
Thanks
|