Support » Fixing WordPress » .htaccess and permalink: Internal server error after checking everything

  • After spending over 20+ hours trying to fix the problem I give up and would really appreciate any help.

    What exactly is my problem?
    After installing my wordpress (not into root, but http://www.mypage.cz/blog), I wanted to optimize the blog with permalinks. So I went to the permanent links page and chose /%category%/%postname%/ (tried it with many many combinations of other things too) and what it does is generate a 500 Internal server error: The server encountered an internal error or misconfiguration and was unable to complete your request.

    So I looked through all the info, checking that I have mod_rewrite running on server.
    Server info: MySQL – 5.0.27, PHP Version 5.1.6, Linux, Apache 2.0,
    AskApache RewriteRules Viewer:
    > Permalink: /%category%/%postname%/
    > Writable .htaccess file found
    > mod_rewrite found
    > Not using pathinfo style index permalinks
    > Using mod_rewrite permalinks
    ..so that should be all allright.

    The weird thing is that the .htaccess file was not generated by the installation and has always been created by trying to change the permalink, which in turn showed the error. Actually, I had to delete or rename the /blog/index.php and only after that was the .htaccess file created. Then after I deleted the .htaccess file and rename index.php back the blog is working fine again, but if I click on post caption it redirects me to a correct name (given by permalink), but sais The web page cannot be found. ???

    Oh mod_frontpage is not runnning if that is of relevance (on the server).

    Apparently the error always shows when there is .htaccess file present in the http://www.somepage.cz/blog/ directory (i.e. http://www.somepage.cz/blog/.htaccess)

    Content of the .htaccess file I use:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>
    # END WordPress
    , but as I say, whenever I tried to put some content (not empty) .htaccess file to the /blog/ root, it displays the error.

    – Tried getting rid of the <IfModule .. and </IfModule, just running it – no help.
    – Tried changing “includes/vars.php” ( $is_apache = 1; ) – no help

    Thanks for your help, hope I gave you all the info needed, if there is anything else relevant, please say so and I’ll post it asap.

Viewing 7 replies - 1 through 7 (of 7 total)
  • oh and I tried Options +FollowSymlinks before the .htaccess code too and .htaccess is CHMOD 666

    Shakhawat

    (@shakhawat_jaheed)

    Is WordPress super cache plugin installed & activated? If so, make a backup copy of .htaccess & cleanup all parameters in .htaccess.

    Thanks for an idea, but nope – don’t have any plugins at all, just the AskApache RewriteRules Viewer 3.0, might have been there before, but i tried total reinstall (cleaned database too) and now deal with it from the clean 2.7 freshly installed version so as to not make some mistakes (??) in the preferences.

    this is the exact problem I am having, and of course it doesn’t surprise me to see that it was never answered. these forums have gotten noisier, yet weaker over the years.

    one possibility: you’ve saved the HTACCESS file using a text editor, and accidentally saved it in RTF or another format, rather than plain text. this was my problem. hard to find/realize but easy to fix…

    Hi,

    Remove all unwanted code from htaccess and set your desired category. After that add this code in htaccess:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Now, have a check with old and new posts of your blog.

    Thanks,

    Shane G.

    I was having the same exact trouble. Did the suggestion that Shane G recommended and now it works perfectly! THANK YOU!

    In my website hosting situation, I have my domain set to a subfolder in public_html, rather than in the root public_html folder. In other words, going to mywebsite.com actually goes to a sub-folder named “mywebsite” in public_html, not directly to public_html.

    My main .htaccess (in public_html) needed to be set to:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?mywebsite.com$
    RewriteCond %{REQUEST_URI} !^/mywebsite/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /mywebsite/$1
    RewriteCond %{HTTP_HOST} ^(www.)?mywebsite.com$
    RewriteRule ^(/)?$ mywebsite/index.php [L]

    Then, inside the /mywebsite/ folder, my .htaccess file was set as per Shane G’s post:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Many thanks, O First Result on Google!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘.htaccess and permalink: Internal server error after checking everything’ is closed to new replies.