重寫,我發現關於URL重寫一些問題: .htaccess: Problem with URL rewriting或 .htaccess question - URL-rewriting網址的.htaccess
我想他們的方法,但不工作在我的情況? 礦看起來很簡單:
http://example.org.uk/member/home.php?profile --> http://example.org.uk/member/home/profile/
http://example.org.uk/member/home.php?history --> http://example.org.uk/member/home/history/
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^home/([0-9][0-9])/$ /home.php?$1
RewriteRule ^/([^/]+).php$ /home.php?$1 [L]
任何thougt是appricated?謝謝
您的規則和示例相互矛盾。你想把`home.php?profile`映射到`home/profile`(例子)還是`home/profile`被重寫爲`home.php?profile`(重寫代碼)? – 2011-01-28 17:53:26
@Linus:我想映射到家庭/配置文件,並刪除PHP前。 – tonoslfx 2011-01-28 17:54:45