简体   繁体   中英

URL Rewrite for WIndows Server 2003

unfortunately I'm having difficulty getting a URL rewriter to work. Can anyone help?

We had actually running a site on a Windows Server - 2003.

However all is not lost, because it says that there is an .htaccess style URL rewriter available for me to use. This is important as it allows us to show SEO friendly urls.

Anyway, we have switched it on, and we have uploaded an .htaccess file which contains what i think is the correct Regular Expressions, but it is not working.

RewriteRule ^Health/([0-9]+)/?$    Health/Article.aspx?ArticleId=$1 [NC,L]

Can anyone confirm that my Regular expression is right or wrong

http://mydomain.com/Health/Article.aspx?ArticleId=1

should work like so..

http://mydomain.com/Health/1/Im-a-vegetarian

Remove $ since your URL has some slug in the end. Try this rule:

RewriteRule ^Health/([0-9]+)/ Health/Article.aspx?ArticleId=$1 [NC,L,QSA]

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM