如何使用.htaccess重写:
mysite.com/profile/[username]
转到:
mysite.com/profile.php?id=[username]
我不想重新加载页面,只需更改 URL 以使其看起来更好即可。
感谢任何帮助。
最佳答案
这是应该帮助您入门的 htaccess 规则:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule profile/(.+) profile.php?id=$1
关于php - 重写个人资料页面的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26860602/