使用 Mod-Rewrite 重写 URL [英] Rewriting URLs with Mod-Rewrite
本文介绍了使用 Mod-Rewrite 重写 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将如何重写:
http://localhost/profile.php?user=MaFi
到
http://localhost/user/MaFi
推荐答案
试试这样的 RewriteRule:
Try a RewriteRule like this:
RewriteRule ^profile.php?user=(.*)$ /user/$1 [R=301,L]
这篇关于使用 Mod-Rewrite 重写 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文