开发者

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

开发者 https://www.devze.com 2023-03-04 03:36 出处:网络
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

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

精彩评论

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