2
我正在使用友好網址的網站上工作。我們希望www.website.com/johndoe
轉到John Doe的個人資料,但我們也使用www.website.com/somepage
表單指向www.website.com/somepage.php
這樣的網頁。我們怎樣才能做到這一點? (物理PHP頁面應該優先於用戶頁面 - 我們會禁止反正一定的用戶名)htaccess個人資料網址與網頁網址
# Redirect all URLs to the corresponding PHP page
RewriteRule ^([A-Za-z0-9-_]+)$ $1.php [L]
# And if that's not found, try a user's profile
RewriteRule ^([A-Za-z0-9-_]+)$ profile.php?id=$1 [L]
你可能想通過`/ user/johndoe`來防止... – SeanJA 2010-11-25 04:11:22