开发者

How to show a user profile by passing username just after the domain name

I am creating a site with Codeigniter. I have to show the customers profile page when a customer type his username after 开发者_开发问答the domain, like " www.mydomain.com/username ". please give me an advice. Thanks in advance...


$_SERVER['REQUEST_URI'] will hold this information in PHP. Your htaccess redirect should look something like:

RewriteRule ^([^/\.]+)/?$ /index.php?i=$1 [L]

Then in index.php $_GET['i'] will hold the value of whatever is in the URL after the domain

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜