WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Excluding certain file extension in wordpress htaccess code (3 posts)

  1. SEOguruNL
    Member
    Posted 2 years ago #

    The .htaccess code generated by wordpress performs its rewrite action when nor the file nor the directory exists. Ok, but here my problem.

    I don't always want that to be the case: I have cgi-scripts running that also have to be rewritten. So therefore I would like the wordpress code in the .htaccess to exclude .cgi extensions. I could add an extra exclusion line in the wordpress code, but that code is overwritten by wordpress (when I change my permalink settings for example).

    Does anybody know of a better idea?

    Thanks a lot!

  2. In your .htaccess file, above your # BEGIN WordPress line put in these lines:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .*\.cgi - [L]
    </IfModule>

    If those CGI files actually exist, then this shouldn't be necessary. The WordPress additions to .htaccess should not be effecting any file or directory that actually exists; they check if the file or directory exists before engaging the rewrite rule.

  3. SEOguruNL
    Member
    Posted 2 years ago #

    That's it!

    Jan, you are my hero today.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags