htaccess 重写规则重复 - 请帮帮我 / RewriteRule ^(.*)\+apple\+fruit/$ ?q=$1 [L]
我的 .htaccess 中有这段代码:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\+apple\+fruit/$ ?q=$1 [L]
这会将搜索查询转入 /keyword+apple+fruit/
,没关系。唯一的问题是,如果我输入 /keyword+apple+fruit +any+text+haha+< /strong> 苹果+水果/ htacces 正在显示内容 - 但我不想要这样。
是否有任何命令可以说 - 好吧,苹果+水果仅在网址中一次,第二次发送 404 或不显示任何内容..
谢谢!!
I have this code in my .htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\+apple\+fruit/$ ?q=$1 [L]
this turns the searchquery in /keyword+apple+fruit/
thats ok.. the only problem is, if I type in /keyword+apple+fruit +any+text+haha+ apple+fruit/
the htacces is showing content - but I don't want that.
is there any command to say - ok apple + fruit only one time in the url and the second time send a 404 or show nothing..
thank you!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
RewriteCond
排除这种情况:You can use a
RewriteCond
to exclude such a case: