Kishan
Kishan

Reputation: 126

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?

Upvotes: 0

Views: 79

Answers (1)

technomav
technomav

Reputation: 36

<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....

Upvotes: 2

Related Questions