954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

UserName as URL ( Apache htaccess ) PHP?

I am developing a PHP Web Application and I know about htaccess ( and how to create the htaccess file ). I have activated mod_rewrite in XAMPP ( I am testing it locally ). The current Profile URL is:

localhost/app/user.php?name=AbhishekBiswal
Where Abhishek Biswal is the UserName.
I want it to look like:
localhost/app/AbhishekBiswal

Please include the htaccess code in your answer. Thanks In Advance.

AbhishekBiswal
Newbie Poster
9 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

when user signs up, you could use

mkdir($username)


and in that dir, you could make index.php, and in index.php use file_get_contents (making sure that any images or links a relative to the directory, or use absolute urls) to get the contents of user.php?name=$username

Matthew N.
Junior Poster
101 posts since Jul 2010
Reputation Points: 10
Solved Threads: 10
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: