duancai7568
2017-07-21 07:30
浏览 69
已采纳

当最后没有反斜杠时,Mod重写会继续追加GET字符串

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?route=$1

With that rewrite rules, if I enter any link that doesn't end in a backslash, GET string is appended at the end.

Examples:

localhost/forum/ shows as localhost/forum/

localhost/forum shows as localhost/forum/?route=Forum

图片转代码服务由CSDN问答提供 功能建议

  RewriteEngine on 
RewriteCond%{REQUEST_FILENAME}!-f 
RewriteRule ^(。*)$ / index  .php?route = $ 1 
   
 
 

使用重写规则,如果我输入任何不以反斜杠结尾的链接, GET 最后附加了一个字符串。

示例:

localhost / forum /显示为localhost / forum /

localhost / forum显示为localhost / forum /?route = Forum

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题