.htaccess - rewrite url from example.com?prodid=qwerty to exmaple.com/abc.php?prodid=qwerty -


i want redirect from

http://www.example.com/partnerlogin?authid=abcde79989#$@hk

to

http://www.example.com/partnerlogin.php?authid=abcde79989#$@hk

rewriteengine on  rewritecond %{query_string} ^partnerlogin?authid=$ [nc] rewriterule ^partnerlogin?authid=$ partnerlogin.php?authid= [nc,l] 

i writing above in .htaccess not working, result getting is:

the requested url example.com/partnerlogin not found.

rewritecond %{query_string} ^partnerlogin?authid=$ [nc]
rewriterule ^partnerlogin?authid=$ partnerlogin.php?authid= [nc,l]

partnerlogin not part of query_string , authid not part of url-path matched rewriterule pattern. query string not end ($) after authid=.

try following instead:

rewriteengine on rewritecond %{query_string} ^authid= rewriterule ^partnerlogin$ partnerlogin.php [l] 

the query string (ie. authid=abcde79989) automatically copied across substitution url. i've removed nc flags. unless need case-insensitive match, these not required.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -