这是我的.htaccess
。它重定向/contact
到index.php?page=contact
这很好用。但有了这个.htaccess
,如果有人把,他们会得到一个错误。.htaccess url重写
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_URI} !index\.php [NC]
RewriteRule ^([^/]+)/?$ index.php?page=$1 [QSA]
基本上,有没有什么办法,如果有在URL中没有.php
只改写?
如果网址中有.php
,例如contact.php
只是加载正常.php
页面。
我该怎么做?
可能重复http://stackoverflow.com/questions/1698464/mod-rewrite-去除php-but-still-serve-the-php-file) – typeoneerror