我的 mod_rewrite 规则是错误的,我似乎不知道如何编写它来为我工作
这是我当前的 .htaccess 文件: (它在我的个人 WAMP 服务器上运行。并且 Mod_Rewrite 在我的服务器上启用。)
<IfModule mod_rewrite.c>
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /rdypages/
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ /rdypages/index.php?company=$1&page=$2
</IfModule>
我的 /rdypages/index.php 文件旨在在 quesystring 中查找以下参数: 公司和页面。这是一个示例地址:
http://localhost:8888/rdypages/index.php?company=test&page=test.htm
这就是我希望它看起来像的样子:
http://localhost:8888/rdypages/test/test.htm
我的 .htaccess 文件的 RewriteRule 应该说什么? 谢谢
Here is my current .htaccess file:
(it is running on my personal WAMP server. And Mod_Rewrite is enable on my server.)
<IfModule mod_rewrite.c>
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /rdypages/
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ /rdypages/index.php?company=$1&page=$2
</IfModule>
My /rdypages/index.php file is design to look for the following parameters in the quesystring:
company and page. Here is an example address:
http://localhost:8888/rdypages/index.php?company=test&page=test.htm
and this is what I would like it to look like:
http://localhost:8888/rdypages/test/test.htm
What should my .htaccess file's RewriteRule say?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了:
我已经测试过它并且工作正常!
i figured it out:
I have tested it and it works fine!