Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Redirect - case insensitive

How I can make a robust permanet redirection from a link like https://example.com/products to https://example.com/newPath

The redirection should work case insensitive. For example the call https://example.com/ProDucTs should also work.

I think the solution should contain something like this

RewriteCond ????? [NC] RewriteRule ?????[L,R=301]

like image 202
Christian Avatar asked Apr 19 '26 18:04

Christian


1 Answers

You can set these two rules in your htaccess file

RedirectMatch 301 (?i)/android-app  https://play.google.com/app-url

or

RewriteRule ^products$ /newPath? [L,R=301,NC] 

In above two rules "?i" and "NC" for case insensitive.

like image 130
Irfan Ali Avatar answered Apr 21 '26 20:04

Irfan Ali



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!