Help in apache rewrite needed

Discussion in 'Apache' started by dorgefen85, Nov 9, 2010.

  1. #1
    Hi All,

    I'm trying to rewrite all URLS in my website to lowercase.
    This is what i have changed in htaccess:
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_URI} [A-Z]
    RewriteRule (.*) ${lc:$1} [R=301,L]

    and this is the change in httpd.conf:
    RewriteMap lc int:tolower

    the lowercase rewriting is working but i want it to be done only for .html files and only for specific folder
    e.g
    www.SITE.com/test/folder/file.html
    only to lowercase all URL if Test folder is included.

    Thank in advance
     
    dorgefen85, Nov 9, 2010 IP
  2. tnd8

    tnd8 Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this

    RewriteCond %{REQUEST_URI} ^/test-folder/(.*).html

    or place your .htaccess in /test-folder and try following:

    RewriteCond %{REQUEST_URI} (.*).html
     
    tnd8, Nov 12, 2010 IP