Unfamiliar .htaccess RewriteCond statements (3 posts)

  1. kgagne
    Posted 2 years ago #

    I have several security plugins running on multiple sites, but one site's .htaccess file is unique in having this block of code:

    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^[^=]*$
    RewriteCond %{QUERY_STRING} %2d|\- [NC]
    RewriteRule .? - [F,L]

    I'm unsure what it does or if it belongs there. Can someone help me decrypt it?

  2. Evan Herman
    Posted 2 years ago #

    RewriteEngine on

    I know that that is an apache module that needs to be on when you switch permalinks. I only know this becuase when I was developing my last site locally I had switched permalinks and nothing was working, after a little research I read up on switching the rewrite engine on, I did that and everything worked again. But that's as much as I know

  3. kgagne
    Posted 2 years ago #

    Thanks, Evan.

    Most of my .htaccess files have this block of code:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{QUERY_STRING} ^(%2d|-)[^=]+$ [NC]
    RewriteRule ^(.*) $1? [L]

    The query in my original message is slightly different. I'm still unsure why.


Topic Closed

This topic has been closed to new replies.

About this Topic