【发布时间】:2016-01-11 08:00:30
【问题描述】:
我正在使用 XAMPP (Windows 7),在 httpd.conf 中我有:
- 允许全部覆盖
- LoadModule rewrite_module modules/mod_rewrite.so(未注释)
在 htdocs 目录中,我有一个名为 shop 的子目录,我的网站在哪里。在 shop 内,我还有一个名为 shirts 的子目录,其中包含该文件:
- shirts.php
要打开它,您只需输入以下网址:http://localhost/shop/shirts/shirts.php
但是,当我只打开 http://localhost/shop/shirts/ - 浏览器会显示一个目录列表,我希望它打开 shirts.php。
所以,在 /shirts 目录中,我创建了以下 .htaccess 文件:
RewriteEngine On
RewriteRule ^shirts/$ /shop/shirts/shirts.php
但它不起作用。你知道我做错了什么,为什么这不起作用?
提前致谢!
【问题讨论】:
标签: php .htaccess xampp rewrite