【发布时间】:2013-05-17 10:01:15
【问题描述】:
通常,访问我的网站时,qpcftw.cu.cc 会透明地加载页面 qpcftw.cu.cc/index.php,而不会在 url 中显示 /index.php 部分。我一直在尝试使用 .htaccess 摆脱 .php 扩展。这是我的 .htaccess 文件的内容:
<Files />
ForceType application/x-httpd-php
</Files>
RewriteEngine on
RewriteBase /
RewriteRule ^.htaccess$ - [F]
RewriteRule ^([A-z,0-9,_,-]+)?$ $1.php [QSA]
RewriteRule ^([A-z,0-9,_,-]+)/index\.html$ $1.php [QSA]
ErrorDocument 403 php/error.php
ErrorDocument 404 /404.php
ErrorDocument 405 php/error.php
ErrorDocument 408 php/error.php
ErrorDocument 500 php/error.php
ErrorDocument 502 php/error.php
ErrorDocument 504 php/error.php
我需要满足 3 个条件:
-
qpcftw.cu.cc/index.php==qpcftw.cu.cc/index - 访问
qpcftw.cu.cc/forum/仍然会在qpcftw.cu.cc/forum/index.php加载我的PHPBB 论坛 -
qpcftw.cu.cc透明地加载index.php文件,但 URL 中不显示它
到目前为止,我当前的 .htaccess 满足了前两个需求,但打破了第三个需求。帮助! :/
【问题讨论】: