需要有关 mod_rewrite 规则的帮助
我正在使用 PHP 的 RouteMap 并希望清理该网址。
URL 的形式为:
http://localhost/subfolder/index.php?controller/method/arg1
我如何将其转换为:
http://localhost/subfolder/controller/method/arg1
I'm using PHP's RouteMap and want to clean up the URL.
The URL's come in the form of:
http://localhost/subfolder/index.php?controller/method/arg1
How would I convert this to:
http://localhost/subfolder/controller/method/arg1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
还没有测试过,但我想你会想要以下内容:
haven't tested it, but I think you will want the following:
您可以在 httpd.conf 文件中尝试此操作:
应该可以。我会更改最后一行,但是:
现在,在重新启动 apache 之前,尝试测试配置文件是否正常。
就是这样。
希望有帮助。
干杯
You can try this in your httpd.conf file:
That should work. I would change the last line, tho:
Now, before you restart apache, try to test if the config file is ok.
And that's about it.
Hope it helps.
Cheers
可以按顺序应用同一 .htaccess 文件中的多个重定向,这就是它的作用
Multiple redirects in the same .htaccess file can be applied in sequence, which is what this does