Apache Rewrite - NO case sensitivity

Discussion in 'Apache' started by atario, Dec 23, 2009.

  1. #1
    Happy Holidays everyone, btw!

    Hi, i really have no clue what i'm doing, i'm just following tutorials. But [NC] doesn't work in this case.

    What I really want is have www.mysite.com/blog to redirect to my subdomain blog.mysite.com. IT WORKS!

    BUT, www.mysite.com/BLOG or if the cases do not match exactly to 'blog', then it'll be 404. Why is that?

    I tried replacing [L,R=301] to [NC] or [L,R=301,NC] and stuff, no luck.. Any help would be fabulous, thanks in advance.

    Options -Indexes +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^mysite.com [NC]
    RewriteRule ^(.*)$ http://www.mysite.com/blog$1 [L,R=301]
    RedirectMatch 301 ^/blog/(.*)$ http://blog.mysite.com/$1


    -------------------------

    I figured out a minor fix, but it`s not complete. And it`s adding this to the end..

    RewriteCond %{HTTP_HOST} ^site\.com [NC]
    RewriteRule ^blog/(.*)$ http://blog.site.com/$1 [NC,R=301,L]
    RewriteRule ^(.*)$ http://blog.site.com/$1 [R=301,L]

    However, if i type www.site.com/BLOG it`ll redirect to blog.site.com/blog, which is not what I want also!!

    Any help would be greatly appreciated, thanks in advance!
     
    atario, Dec 23, 2009 IP