这个问题在这里已有答案:
我用.htaccess来改变我的网址
http://example.com/profile.php?user_id=115451
至
http://example.com/profile/115451
这是我的.htaccess它对我有用。
RewriteEngine On
RewriteRule ^profile/([^/]+)/?$ profile.php?user_id=$1 [L,QSA]
但在我的profile.php中有这样的标签
<a href='./'>Home</a>
当我点击这个链接它应该转到http://example.com/但它转到http://example.com/profile/
与img标签相同的问题,http://example.com/profile/115451上的图片无法加载,
您正在寻找的是:
<a href='/'>Home</a>
.htaccess无变化