我的網址是象下面這樣:URL重寫引導
http://localhost/project/test/jobs/?page=accounting
<a href="<?php echo BASE_URL; ?>jobs/?page=accounting">Accounting</a>
,我想使象下面這樣:
http://localhost/project/test/jobs/accounting
我有搜索其它的問題,但無法做到這一點。因爲我完全不知道這個的.htaccess重寫過程:(
但是我有下面的代碼已經在我的htaccess文件刪除PHP擴展:
RewriteEngine On
# Unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ http://example.com/folder/$1 [R=301,L]
# Redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$ http://example.com/folder/$1 [R=301,L]
# Resolve .php file for extensionless php urls
RewriteRule ^([^/.]+)$ $1.php [L]
請幫我添加URL重寫規則上面htaccess文件沒有鬆動.PHP內線統治。
OP要htaccess規則兄弟。 – devpro