我希望使用干净的网址,以便为访问者提供http://localhost/MYEVENTS/filename/而不是http://localhost/MYEVENTS/filename.php
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /MYEVENTS/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /MYEVENTS/index.php [L]
RewriteRule ^([a-z]+)\/?$ $1.php [NC]
</IfModule>
答案 0 :(得分:0)
尝试一下
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php