I'm trying to create a new redirect for my v2.2 api.php file. The desired link is: website.com/api/v2.2/ but rewrite just works if I use _ instead of /:
website.com/api_v2.2/ (WORKS):
RewriteRule ^api_v2.2/?$ /api.php [NC,QSA,L]
website.com/api/v2.2/ (DON'T WORKS):
RewriteRule ^api/v2.2/?$ /api.php [NC,QSA,L]
Any idea? I've tried these lines too, but nothing works:
RewriteRule ^api\/v2.2/?$ /api.php [NC,QSA,L]
RewriteRule ^(api)/v2.2$ api.php [QSA,NC,L]
Have you tried escaping the dot and slashes ?
RewriteRule ^api\/v2\.2\/?$ /api.php [NC,L]
The dot may cause problem here since it means "Any character" in the regex (source). Moreover, I don't think you need the QSA flag here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With