【发布时间】:2014-05-29 09:28:58
【问题描述】:
所以我对 Apache 的 mod_rewrite 有点挣扎,但最终设法配置(是)并理解它(也许?)。
当用户转到/index 时,他们会看到/index.php 页面,并且浏览器的网址是http://example.com/index。
用户也可以访问/index.php,浏览器的url为http://example.com/index.php。
RewriteEngine On
RewriteBase /
RewriteRule ^index$ /index.php
RewriteRule ^$ /index.php
所以我的问题是,如何仅使用服务器的配置将用户从 /index.php 重定向到 /index?
【问题讨论】:
-
请告诉我们你的重写规则!
标签: php apache .htaccess mod-rewrite