Title: mod_rewrite generating Internal Server errors?
Last modified: August 18, 2016

---

# mod_rewrite generating Internal Server errors?

 *  [Xial](https://wordpress.org/support/users/xial/)
 * (@xial)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/)
 * I grabbed WP out of CVS today, deciding I’ll start over from scratch again, if
   it’s what it takes to get things working again.
    It had creation of permalinks
   to use with mod_rewrite. I thought this’d be a good thing for me. However, what
   I ended up with was an Internal Server Error on its inclusion. The contents of
   my .htaccess, just in case it’s other contents are relevant: _DirectoryIndex 
   index.php index.html ErrorDocument 404 /404.php ErrorDocument 403 /403.php ErrorDocument
   500 /500.php ServerSignature Off Options +MultiViews **RewriteEngine On RewriteBase/
   RewriteRule ^/?a/?([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9a-z-]+)?/?$/
   weblog?year=$1&monthnum=$2&day=$3&name=$4 [QSA] The portion at the end is what
   I just added, from what WordPress gave me for creating my preferred cleaner links.
   Is there something I have missed?

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

 *  [Mike Little](https://wordpress.org/support/users/mikelittle/)
 * (@mikelittle)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-25844)
 * Hi Xial,
    On my setup at home If I use the contents you pasted a bove, I also
   get a 5-00 error. However, by a process of elimination, I determined that it 
   was the DirectoryIndex line which was causing me problems. The rest seems to 
   be ok. Check in your error log it may yield a clue. Mine said “…/wordpress/.htaccess:
   DirectoryIndex not allowed here” One check worth making is that if your server
   is a unix box, then you need to make sure that the line endings for the .htaccess
   file are correct. Mike
 *  [Dougal Campbell](https://wordpress.org/support/users/dougal/)
 * (@dougal)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-25864)
 * You do have the RewriteRule as one long line, right?
    <pre> RewriteRule ^/?a/?([
   0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9a-z-]+)?/?$ /weblog?year=$1&monthnum
   =$2&day=$3&name=$4 [QSA] </pre>
 *  [Laughinglizard](https://wordpress.org/support/users/laughinglizard/)
 * (@laughinglizard)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-25866)
 * Dougal’s comment makes a lot of sense. From your above log file, it looks like.
   htaccess sees the $ as the end of the RewriteRule . Here is a good guide from
   apache for mod_rewrite understanding [http://www.engelschall.com/pw/apache/rewriteguide/](http://www.engelschall.com/pw/apache/rewriteguide/)
 *  Thread Starter [Xial](https://wordpress.org/support/users/xial/)
 * (@xial)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-25884)
 * dougal:
    I tried it split over two lines, and as one long line. I’m thinking 
   this thing just hates me because it can. 😡 I even removed the original RewriteRule
   line, and put the one you have in, and I return to the first error I was getting:[
   Fri Nov 7 00:15:36 2003] [alert] [client 45.69.105.badjoke] /my/path/to/.htaccess:
   RewriteRule: bad argument line ” [Fri Nov 7 00:15:41 2003] [alert] [client 45.69.105.
   badjoke] /my/path/to/.htaccess: RewriteRule: bad argument line ” I know I’ve 
   got mod_rewrite available, as other things on my site are using it, such as Gallery(
   gallery.sf.net). I just can’t figure out why this thing hates me like that. I’ll
   wait for another day.
 *  Moderator [Matt Mullenweg](https://wordpress.org/support/users/matt/)
 * (@matt)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-25922)
 * If you’re a pico fan (like I am) you’ll love [nano](http://www.nano-editor.org/).
 *  Thread Starter [Xial](https://wordpress.org/support/users/xial/)
 * (@xial)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-26014)
 * I’ve got nano installed for myself on my box, but I need to talk to my host about
   nano replacing pico on the server. 😉
    Until then, I’m using jEdit from my side,
   with the SFTP plugin, which always has its bonuses.
 *  [Ruby Sinreich](https://wordpress.org/support/users/rubyji/)
 * (@rubyji)
 * [21 years, 9 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-26496)
 * I think I’m having the same problem, but I can’t figure it out. My .htaccess 
   file works fine with just the ErrorDocuments, and it’s even OK with the first
   two lines: `RewriteEngine On
    RewriteBase /
   
    When I use pico or nano to paste
   the rewrite rules, I get a 500 internal server error. If I upload .htacccess 
   via Dreamweaver/FTP it get a 404! This seems better than the 500, but still not
   OK. (I am using Dreamhost and I have turned off ‘Run PHP as CGI.’ )
 *  [Ruby Sinreich](https://wordpress.org/support/users/rubyji/)
 * (@rubyji)
 * [21 years, 9 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-26497)
 * Omygod, I fixed it. Pasting the rewrite rules via the WordPress interface did
   the trick!
 *  Anonymous
 * [21 years, 7 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-26510)
 * I had a similar problem, that it took a while to fix. For the convenience of 
   others who might search here later:
    Adding mod_rewrite rules gave a 500-error,
   even though mod_rewrite was built into the apache. Checking the error log, it
   gave: /.htaccess: RewriteEngine not allowed here It turns out that you need to
   allow FileInfo override in httpd.conf: AllowOverride FileInfo Remember, this 
   must be IN ADDITION to whatever directives are already allowed. Example: AllowOverride
   Limit FileInfo
 *  [biag](https://wordpress.org/support/users/biag/)
 * (@biag)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-26555)
 * Unregistered user, you are great. 🙂
    As you imagined, your info has been helpful
   for “another who is searching here later”. Actually *much* later…

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

The topic ‘mod_rewrite generating Internal Server errors?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 8 participants
 * Last reply from: [biag](https://wordpress.org/support/users/biag/)
 * Last activity: [19 years, 9 months ago](https://wordpress.org/support/topic/mod_rewrite-generating-internal-server-errors/#post-26555)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
