1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Apache 2.2.x AllowOverride can i use it in negative way?

Discussion in 'Apache' started by postcd, Sep 24, 2017.

  1. #1
    i assume that on the Apache 2.2 server when someone want to run perl/python script, he add this line to the .htaccess:
    AddHandler cgi-script .cgi .pl

    I would like to prevent Apache following this .htaccess directive/rule. My aim is that by default all .htaccess can not set handler for .cgi .pl .py

    I thought that on Apache 2.2.x, i can use AllowOverride directive in global httpd.conf to somehow achieve that, but i am unsure how that directive should look like to work.

    Here i am quoting related answers from other similar topic:

    (this is what i have just done)

    Above things are meant for Litespeed, so i do not know if can work.

    PS: Apache 2.4 is claimed to support "AllowOverrideList"

    Current Apache global config file:
    Last edited: Sep 24, 2017
    postcd, Sep 24, 2017 IP
  2. hostechsupport

    hostechsupport Well-Known Member

    Likes Received:
    Best Answers:
    Trophy Points:
    Hello postcd,
    >> In your main apache config file, add the directive AllowOverride None.

    This will prevent it from looking at .htaccess files directives.

    For more info, see http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride

    Example: <Directory ...>
    AllowOverride all
    <Directory ...>
    AllowOverride none

    Hope this helps you:)
    hostechsupport, Oct 26, 2017 IP