如何做好外部重定向和参数重定向、如何做好、参数

2023-09-02 00:56:46 作者:爱是自讨苦吃

我怎么做一个外部重定向和的.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]