dongsu0308 2014-02-13 16:46
浏览 104
已采纳

htaccess重写 - 不重写index.php 2

RewriteRule ^Interface/Base/Login.aspx?ReturnUrl=%2findex.html.var$ Interface/Base/Login.aspx [R,NC,L] 

is not working. I want it to redirect to Login.aspx so it can work this is mapping another site by doing

RewriteRule (.*) http://xx.xx.xx.xx:8880/$1 [P,L]

Rewrite file is as follows:

RewriteEngine On
RewriteBase /
RewriteRule ^Interface/Base/Login.aspx?ReturnUrl=%2findex.html.var$ Interface/Base/Login.aspx [R,NC,L]
RewriteRule (.*) http://xx.xx.xx.xx:8880/$1 [P,L]

IP is hidden for protection.

  • 写回答

1条回答 默认 最新

  • douguanyan9928 2014-02-13 16:52
    关注

    You can't match query string in RewriteRule use RewriteCond %{QUERY_STRING} like this:

    RewriteCond %{QUERY_STRING} ^ReturnUrl=.*?index\.html\.var$ [NC]
    RewriteRule ^Interface/Base/Login\.aspx$ /Interface/Base/Login.aspx? [R,NC,L] 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?