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