简体   繁体   中英

Htacces redirect php for case sensitive

Hello i have following url and redirect to another url by using .htaccess file. Following examples of urls:

http://www.ussafety.com/Apco to http://72.3.171.36/s/Apco
http://www.ussafety.com/APco to http://72.3.171.36/s/Apco
http://www.ussafety.com/APPo to http://72.3.171.36/s/Apco
http://www.ussafety.com/ApcO to http://72.3.171.36/s/Apco

So i have one url with different change of letter of apco word. So can it possible to redirect by entering changing leeter of word with only one line code in htacces?

<IfModule mod_rewrite.c>
 RewriteCond %{REQUEST_URI} http://www.ussafety.com/apco [NC]
 RewriteRule .* http://72.3.171.36/s/Apco [R=301,L] 
</IfModule>

Use the [NC] flag after writing the redirect condition.That tells Apache to ignore casing for the pattern match. Just write all character in lowercase in condition statement....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM