我正在一个网站上使用友好的网址。我们想拥有
www.website.com/johndoe
转到John Doe的个人资料,但我们也使用
www.website.com/somepage
窗体指向类似于
www.website.com/somepage.php
. 我们如何才能做到这一点?(physical.php页面应优先于用户页面-无论如何,我们将禁止某些用户名)
# 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]