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
精彩评论