这是那里的PHP文件是:
ts1.WEBSITENAMEHERE.biz/cp /
.htaccess文件也是这个文件夹中。 我想删除从FILENAME.PHP的.PHP。
这是我目前的'的.htaccess文件:
选项+了FollowSymLinks
RewriteEngine叙述上
的RewriteBase / CP
重写规则^(。*)/ $ $ 1.PHP
但它不工作。这是为什么?
解决方案 RewriteEngine叙述上
的RewriteBase / CP /
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME! PHP $
重写规则。* $ 0.php [L]
This is where the PHP files are:
ts1.WEBSITENAMEHERE.biz/cp/
The .htaccess file is also in this folder. I want to remove the '.php' from 'FILENAME.PHP'.
This is my current '.htaccess' file:
Options +FollowSymlinks
RewriteEngine on
RewriteBase /cp
RewriteRule ^(.*)/$ $1.php
But it is not working. Why is this?
解决方案RewriteEngine on
RewriteBase /cp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !.php$
RewriteRule .* $0.php [L]
上一篇:mod_rewrite的PHPmod_rewrite、PHP
下一篇:的.htaccess RewiteCond(QUERY_STRING)与2变量并重写正确重写、变量、正确、htaccess