当查询字符串为空时,.htaccess 重定向到 start.php

发布于 2024-10-05 20:18:01 字数 355 浏览 0 评论 0原文

当尚未设置查询字符串时,我需要重定向到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绝影如岚 2024-10-12 20:18:01

您的正则表达式将匹配任何文本。如果您希望它匹配空字符串,请使用^$

Your regex will match any text. If you want it to match an empty string, use ^$.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文