WordPress.org

Ready to get started?Download WordPress

Forums

Unfamiliar .htaccess RewriteCond statements (3 posts)

  1. kgagne
    Member
    Posted 11 months 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
    Member
    Posted 11 months 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
    Member
    Posted 11 months 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]
    </IfModule>

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

    -Ken

Reply

You must log in to post.

About this Topic