当查询字符串为空时,.htaccess 重定向到 start.php
当尚未设置查询字符串时,我需要重定向到 start.php。 我尝试了以下操作,但并不真正了解 rexex 的作用。
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.*)$ #is there the equal operator = ''?
RewriteRule ^ /start.php/? [L]
</IfModule>
# END WordPress
感谢您的帮助 来自寒冷的问候,兄弟!
桃子
I need a redirect to start.php when theres yet no query string set..
I tried the following, without really knowing what the rexex does.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.*)$ #is there the equal operator = ''?
RewriteRule ^ /start.php/? [L]
</IfModule>
# END WordPress
Thanks for any help
greetings form the cold, braoh!
peachio
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的正则表达式将匹配任何文本。如果您希望它匹配空字符串,请使用
^$
。Your regex will match any text. If you want it to match an empty string, use
^$
.