Support » Fixing WordPress » 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)
  • 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.

    You do have the RewriteRule as one long line, right?
    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]

    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

    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 ( I just can’t figure out why this thing hates me like that.
    I’ll wait for another day.

    Moderator Matt Mullenweg



    If you’re a pico fan (like I am) you’ll love nano.

    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.

    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.’ )

    Omygod, I fixed it. Pasting the rewrite rules via the WordPress interface did the trick!

    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

    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.