I send an urlencoded address like a GET parameter known as fromurl to my page http://localhost/myapp/admin/login.php:


I must enable a better URL around the form using mod_rewrite that we am quite a new comer to. The better URL variant from the example above might have the shape:


I've attempted this line in .htaccess which didn't work (the URL cannot be found):

RewriteRule ^admin/login/(.*)$ admin/login.php?fromurl=$1

I've other mod_rewrite rules working. How must i write the RewriteRule within this situation?

Try getting away your slashes:

RewriteRule ^admin\/login\/(.*)$ admin/login.php?fromurl=$1

Furthermore, you will need to include a rewritebase (prior to the rewrite rule) since you aren't being able to access this using a devoted hostname

RewriteBase /myapp/