mod_rewrite rule to force filename (not including querystring) into lowercase

Posted on 2005-05-04
Last Modified: 2013-11-18

I need a mod_rewrite rule to put all filenames and paths into lowercase i.e.


Question by:armeen
    1 Comment
    LVL 27

    Accepted Solution

    -> works only in httpd.conf in main server config section or Virtualhost (=per server context), but is *not* possible in .htaccess files or <Directory>-Sections, because a RewriteMap is not allowed there:

    RewriteEngine On
    RewriteMap    lowercase    int:tolower
    RewriteRule ^/(.*[A-Z]+.*) /${lowercase:$1} [R=301,L]

    This will forca an external redirection. If it should be just an internal redirect, remove R=301 from the flag to => [L]

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Suggested Solutions

    Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now