WordPress.org

Ready to get started?Download WordPress

Forums

Permalinks kill cgi-bin (4 posts)

  1. haikudegrace
    Member
    Posted 3 years ago #

    Hi all--

    I've searched high and low, and none of the topics that touch on this issue have done the trick.

    I installed WordPress on an existing website in a subdirectory, /blog. I altered the .htaccess file to allow custom permalinks. In doing that, I seem to have rendered my cgi-bin unusable. I get a 404 when I try submitting any of the forms on the site that use .cgi scripts.

    My cgi-bin and .htaccess are in the root, as is the blog directory, where WordPress lives.

    I'm not well versed with .htaccess files, so I'm going on what I've found in the forums here and on other forums. The commented out lines are solutions I've tried that haven't worked.


    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    #RewriteCond %{REQUEST_URI} !^/cgi-bin/
    #RewriteRule ^cgi-bin(/.*)?$ - [L]
    #RewriteRule ^(.*)$ $1.html
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>
    # END WordPress

    Thanks in advance for the help, and apologies if anything I've posted is unclear.

    I'm on 3.1.3.

  2. Alex Concha
    Member
    Posted 3 years ago #

    Have you tried moving your .htaccess to the 'blog' directory?

  3. haikudegrace
    Member
    Posted 3 years ago #

    Hey Alex--

    Thanks for the quick reply. I gave that a shot, but no luck. The issue persists, and I'm not sure what to try next or how to elaborate on the issue in order to help you (or others) help me.

    I'll continue to search and try some things, but if anyone can come to the rescue, I'd be very grateful!

    Thanks.

  4. Alex Concha
    Member
    Posted 3 years ago #

    If you moved to the blog directory, the .htaccess file should look like:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L]
    </IfModule>
    # END WordPress

    Or if you want to leave it in the root, use this

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteRule . /blog/index.php [L]
    </IfModule>
    # END WordPress

Topic Closed

This topic has been closed to new replies.

About this Topic