Search code examples
regexapacheapache-config

Regular expression in apache configuration file


I need to turn off php_flag for some directories on my server.

The directory name is 'images/' and is located in these directories:

/var/www/html/mysite1/images/

/var/www/html/anysitename/images/

/var/www/html/something/images/

....

What regular expression do i need to insert in apache config file?

Thank you.


Solution

  • Try this:

    /var/www/html/(mysite1|something|[^/]+)/images/
    

    Meaning: Either "mysite" or "something" or "a character sequence containing anything but a forward slash".