This is my current .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9a-zA-Z-]+)/?$ index.php?u=$1 [L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
It turns http://www.example.com into example.com AND interprets example.com/username AS example.com/index.php?u=username
Now I want to pass a second argument like example.com/index.php?u=username&e=email and still keep the format example.com/arg1&arg2. How do I do that in .htaccess?
First, you need to move the redirect before your routing rule:
Then, you want to check the 2 argument route:
(this assumes a URL that looks like:
http://example.com/username/emailaddress, but if you really want the&to separate them, use this rule instead:And this assumes a URL that looks like:
http://example.com/username&emailaddressNow your original rule: