0
我想重寫我的PHP應用程序的網址,但它不工作。在Apache2網址重寫不工作
我的目錄結構
/var/www/html/test|
|---.htaccess
|---index.php
我的.htaccess文件內容
# Activates URL rewriting (like myproject.com/controller/action/1/2/3)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
apache2ctl -M
結果:
rewrite_module (shared)
Server版本:阿帕奇/ 2.4.18(Ubuntu的)
我在這個過程中做錯了什麼?請幫忙
每當我嘗試'本地主機/測試/某事/ something_more'它給出錯誤未找到。不應該重定向到index.php? –
沒有錯誤。但在我的'/ etc/apache2/apache2.conf'中''AccessFileName .htaccess'取消註釋 –