Title: Permalinks kill cgi-bin
Last modified: August 20, 2016

---

# Permalinks kill cgi-bin

 *  [haikudegrace](https://wordpress.org/support/users/haikudegrace/)
 * (@haikudegrace)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/permalinks-kill-cgi-bin/)
 * 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.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Alex Concha](https://wordpress.org/support/users/xknown/)
 * (@xknown)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/permalinks-kill-cgi-bin/#post-2159297)
 * Have you tried moving your .htaccess to the ‘blog’ directory?
 *  Thread Starter [haikudegrace](https://wordpress.org/support/users/haikudegrace/)
 * (@haikudegrace)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/permalinks-kill-cgi-bin/#post-2159435)
 * 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.
 *  [Alex Concha](https://wordpress.org/support/users/xknown/)
 * (@xknown)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/permalinks-kill-cgi-bin/#post-2159450)
 * 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
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Permalinks kill cgi-bin’ is closed to new replies.

## Tags

 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [permalinks](https://wordpress.org/support/topic-tag/permalinks/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Alex Concha](https://wordpress.org/support/users/xknown/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/permalinks-kill-cgi-bin/#post-2159450)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
