htaccess mod_rewrite url 的一部分到 GET 变量
我有一些像这样的网址:
http://plutov.by/post/cubique_zf_jquery
http://plutov.by/post/mysql_useful_queries
我如何在 Apache 的帮助下mod_rewrite 打开下一页?
http://plutov.by/post/main?title=cubique_zf_jquery
http://plutov.by/post/main?title=mysql_useful_queries
另外,将是这个新的重写规则与“一个入口点重写”一起使用吗?
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
谢谢。
I have some URLs like these:
http://plutov.by/post/cubique_zf_jquery
http://plutov.by/post/mysql_useful_queries
How can I with help of Apache mod_rewrite open the next pages?
http://plutov.by/post/main?title=cubique_zf_jquery
http://plutov.by/post/main?title=mysql_useful_queries
Also, will be this new rewrite rule work with "one entry point rewriting"?
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要使新的重写规则与“一个入口点重写”一起使用,请让您的
rewriteRules
如下所示:QSA
标志是强制,就像您一样添加新的查询字符串。QSA
Apache 文档。!-l
检查请求的 URI 是否不是符号墨水。To make the new rewrite rule work with "one entry point rewriting", have your
rewriteRules
like this:The
QSA
flag is mandatory as you are adding a new query string.QSA
Apache Docs.!-l
checks that the requested URI is not a symbolic ink.您可以在 .htaccess 中使用类似的内容:
您应该在一个入口点重写规则之前保留此规则。如果规则将触发,则重写规则查找将完成(因为指定了 [L] 选项)
如果您想在 VirtualHost 上下文中使用这些规则,可能需要对路径进行一些修改
You can use something like this in your .htaccess:
You should keep this rule BEFORE one entry point rewriting rules. If rule will trigger then rewrite rule lookup will be finished (since [L] option specified)
Some modification of paths may be required if you want to use these rules in VirtualHost context