如何为.htaccess中的用户配置文件重写URL [英] How to rewrite URL for user profile in .htaccess
本文介绍了如何为.htaccess中的用户配置文件重写URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的用户个人资料URL看起来像这样: http://mysite.com/profile.php?user=Rango
,而我想这样: http://mysite.com/Rango
My user profile URL looks like this: http://mysite.com/profile.php?user=Rango
and I want to make it like: http://mysite.com/Rango
也许有人可以帮个例子吗?
Maybe somebody can help with an example? Thank you very much.
推荐答案
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /profile.php?user=$1 [L,QSA]
这篇关于如何为.htaccess中的用户配置文件重写URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文