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.
-
Answer:
Here you can find a nice htacces tutorial that shows how you can rewrite the urls: http://knol.google.com/k/seo-friendly-url-or-pretty-url-using-apache-mod-rewrite Ansering your question, you could try something like this: RewriteEngine on RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^([^./]+)/?$ /user.php?name=$1 [L]
Alejandro Parodi at Quora Visit the source
Related Q & A:
- How to remove extension and force trailing slash with .htaccess?Best solution by Stack Overflow
- How to rewrite URL using htaccess?Best solution by Stack Overflow
- How to rewrite a URL using htaccess?Best solution by Stack Overflow
- How to store data in php and get data from php?Best solution by Stack Overflow
- What does URL mean when I am asked for the URL while reporting abuse yahoo?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.