-1

Good Morning,

I've been looking into making my product and category URL's SEO friendly by using IIS's URL Rewrite option, however I'm struggling and need some advice.

I'm trying to get the following implemented:

http://www.dibor.co.uk/Product.asp?ProductId=Y054&title=salle-de-bain-dustbin

TO

http://www.dibor.co.uk/prod/Y054-salle-de-bain-dustbin

Please can someone help me on creating the information that needs to be submitted into the URL Rewrite Rule?

From the look of it I need to have: - Pattern - Redirect URL

  • 1
    It would be easier to rewrite it as `http://www.dibor.co.uk/prod/Y054/salle-de-bain-dustbin` – John Jul 29 '15 at 16:42

2 Answers2

0

I think this should be added to the web.config

<rules>
<clear />
<rule name="Products rewrite" stopProcessing="true">
   <match url="^prod/(.*?)\-(.*)" />
   <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
      <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
      <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
   </conditions>
   <action type="Rewrite" url="/Product.asp?ProductId={R:1}&title={R:2}" />
</rule>
</rules>

You could make the rule more specific by adding stuff like:

^prod/(Y[0-9]{3})\-(.*)

But only if you're certain that the product ID is in the format Y000

Fu-Raz
  • 73
  • 7
-2

Change the default 404 error page to 404.asp and parse the url to return the correct information. There is a good example here IIS URL Rewrite ASP

Community
  • 1
  • 1
Brian T
  • 98
  • 3