如何做好外部重定向和参数 [英] How to do External Redirection With Parameters
本文介绍了如何做好外部重定向和参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎么做一个外部重定向和的.aspx后,即可获取URL字符串?
How do I do an external redirection and get the 'URL-String' after .aspx?
http://www.sample.com/folder1/filename.aspx/title
到
http://www.sample.com/folder1/filename/title
我也做了以下
I have done the following
#RewriteCond %{THE_REQUEST} ^[A-Z0-9]{3,}\s([^.]+)\.aspx
#RewriteRule ^ %1 [R=301,NE,NC,L]
但它返回错误的URL
But it returns wrong URL
http://www.sample.com/folder1
鸭preciate你样的建议。谢谢!
Appreciate your kind advice. Thank you!
推荐答案
您可以使用此规则:
RewriteCond %{THE_REQUEST} \s([^.]+)\.aspx(\S*)
RewriteRule ^ %1%2 [R=301,NE,L]
RewriteRule ^([^.]+?)/([^/.]+)/?$ /$1.aspx/$2 [L]
这篇关于如何做好外部重定向和参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文