Home .htaccess doesn't escape question mark on RewriteRule
Reply: 0

.htaccess doesn't escape question mark on RewriteRule

user865
1#
user865 Published in June 19, 2018, 6:27 pm

I have a website with an old type of Single Sign On. A parent website sends users to my website with a URL like:

http://test.instela.fm/index.php?gid=abcd1234&u=thedewil&id=11472

and I want to rewrite it as this:

http://test.instela.fm/login/abcd1234/thedewil/11472

I have created a .htaccess file as following:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^index.php?gid=(.*)&u=(.*)&id=(.*)$ login/$1/$2/$3 [L]

I tried escaping the question mark in the URL as this:

RewriteRule ^index.php\?gid=(.*)&u=(.*)&id=(.*)$ login/$1/$2/$3 [L]

But, unfortunately both these rules don't match and rewrite the URL, which I can't understand why.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.422505 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO