Categorized | News

Disabling Slashes in a .htaccess File

Posted on 03 July 2001 by Demian Turner

Tweaking Apache

Did you know you could use Apache’s httpd.conf to manipulate PHP’s magic quotes ? The following code will set magic_quotes_gpc to “off” for a specific directory, allowing you to bypass changing your php.ini which would affect all the virtual hosts.

Bookmark and Share

3 Comments For This Post

  1. Anonymous Says:

    Of course, for that matter, you could use the built in functions in PHP: get_magic_quotes_runtime(), set_magic_quotes_runtime().

  2. Anonymous Says:

    Hi, I\’ve tried with an .htaccess file like this:

    php_flag magic_quotes_gpc off

    or like this:

    php_value magic_quotes_gpc off

    or like this:

    php_flag magic_quotes_gpc 0

    etc. etc. BUT it doesn\’t work!!!! Can you help me ( Thanks a lot

  3. Anonymous Says:

    I think the problem is here, in the directory section:

    # AllowOverride None
    AllowOverride All
    # Controls who can get stuff from this server.
    Order allow,deny
    Allow from all

    try to comment \’AllowOverride None\’ and change it by \’AllowOverride All\’. Finally, be sure the last two lines appear within the directory directive of htaccess.

Leave a Reply



Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists



PHPkitchen recommends you also check out the following sites :

Accounting for Small Businesses

FreeAgent sign-up