简体   繁体   English

WIndows Server 2003的URL重写

[英]URL Rewrite for WIndows Server 2003

unfortunately I'm having difficulty getting a URL rewriter to work. 不幸的是,我很难让URL重写器正常工作。 Can anyone help? 有人可以帮忙吗?

We had actually running a site on a Windows Server - 2003. 我们实际上已经在Windows Server-2003上运行了一个站点。

However all is not lost, because it says that there is an .htaccess style URL rewriter available for me to use. 但是,一切并没有丢失,因为它说我可以使用一个.htaccess样式的URL重写器。 This is important as it allows us to show SEO friendly urls. 这很重要,因为它允许我们显示SEO友好的URL。

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. 无论如何,我们已将其打开,并且我们已上传了一个.htaccess文件,其中包含我认为正确的正则表达式,但无法正常工作。

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. 删除$因为您的URL末尾有些。 Try this rule: 尝试以下规则:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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