这是我的.htaccess
。它重定向/contact
到index.php?page=contact
这完美地工作。但是有了这个.htaccess
,如果有人放/contact.php
,他们会得到一个错误。
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !index\.php [NC]
RewriteRule ^([^/]+)/?$ index.php?page=$1 [QSA]
基本上,有没有办法只.php
在 URL 中没有的情况下重写?
如果.php
URL 中有一个,例如contact.php
只加载普通.php
页面。
我怎么能这样做?