I need a help writing rewrite rule for the following url pattern
www.mydomain.com/list-of-(buyers|suppers|all)-in-(location-name)/page/10.html
UPDATE:
I have managed to write a rewrite rule which successfully matches the following url:
mysite.com/list-of-buyers-in-goa/page/5.html
.
The same rule is not working for the below url
mysite.com/list-of-buyers-in-goa.html
ie when I remove the page/no
part from the url, it doesn't work. I don't need page/no parameter for the first page.
Since all the other pages on website are .html
pages, just to maintain the uniformity, I want the url to always end with .html
Here is my rewrite rule
<rule name="Rewrite rule for listing members">
<match url="^list-of-([a-z-A-z]+)-in-([a-zA-z-]+)?(\/page\/)?([\d+])?\.html$" />
<action type="Rewrite" url="members.aspx?type={R:1}&location={R:2}&page={R:4}" />
</rule>
--
Try like this;
.*.com\/list-of-(buyers|suppers|all)-in-.*html$
I tested it with "mysite.com/list-of-buyers-in-goa.html" and mysite.com/list-of-buyers-in-goa/page/1234.html , it matched.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.