Hi, let's say I want to use .htaccess to rewrite the following.
Rewriting /user.php?username=xyz
to /xyz
.
I would use:
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ user.php?username=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ user.php?username=$1
The problem is once this is done, how do I access the username in my other links?
so /mike/details.php
How do I get the value of username ('mike') to automatically be added to the URL so it's like:
/username/details.php?username=mike
What would I need to change in .htaccess to get this value? Or do I have to do it in the PHP script to parse the URL?
Thanks