1
因此,這裏是我的正則表達式不能在目錄重寫URL
Options -MultiViews
DirectoryIndex index.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^article/([0-9]+)$ article.php?id=$1 [L,QSA,NC]
RewriteRule ^site/(.*)$ site.php?id=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1\.php -f [NC]
RewriteRule ^(.+?)/?$ /$1.php [L]
而這正是我希望我的URL看起來像:
http://localhost/developer/site/google.com
所以我會做
RewriteRule ^site/(.*)$ site.php?id=$1 [L]
但是當我去的網址,我所得到的全部是
未找到
在此服務器上找不到請求的URL /developer/site/google.com。
即使我在我的developer
文件夾中有一個site.php
。有任何想法嗎?