• CiderJack

    (@ciderjack)


    I’ve found tons of other threads supposedly addressing this issue, but they all apply to really old versions of WP and/or seem to be completely random and unhelpful.

    Using WP 3.9, but also had this issue with 3.8.3. Was hoping it had been fixed, but no. Working on localhost XAMPP with mod_rewrite enabled, but also tested on a ‘live’ host with the same result. I have no .htaccess file on localhost (that I’m aware of) so deleting/repairing that doesn’t work. The only solution I’ve found is to do a fresh install and not change permalinks. Not really acceptable.

    Problem: After changing permalinks, I get a 500 Server Error. Why does this happen and how to fix?

Viewing 15 replies - 1 through 15 (of 17 total)
  • catacaustic

    (@catacaustic)

    To see why you get a 500 error you need to look at the error logs on your server. Depending on your account type these may or may not be available to you, but your hosting company will be able to see what’s happening.

    The first thing that I’d suggest is to check to see that your hosting server does actually allow .htaccess files and can process them correctly. Some servers don’t, and some hosting providers do block these in different ways.

    Nabil

    (@nabil_kadimi)

    First thing, you’re gonna need a .htaccess if you are using permalinks other that the default structure, copy this one: https://codex.wordpress.org/htaccess#Basic_WP.

    If you want to want why you don’t have a .htaccess file, please read “.htaccess Generation Issues” (http://codex.wordpress.org/Using_Permalinks#Fixing_.htaccess_Generation_Issues).

    Now that you have you .htaccess, try this:
    – Re-save permalinks
    – Check that your server allows overriding directives with .htaccess.
    – Check that your server has mod_rewrite enabled

    Thread Starter CiderJack

    (@ciderjack)

    Sorry it took so long – had another issue with the XAMPP crop up that’s taken all week to track down and fix, before I could even get back to this. Anyway…

    Created the .htaccess file as per your first link (which was it’s own bit of hell in Windows, as usual), reinstalled WP, and still have the same issue.

    Following the instructions in number 1 in your second link (fixing .htaccess generation issues), working local so I tried 644, 666, & 777 – each time reinstalling WP, and none of them made a difference. Also mod_rewrite is already enabled.

    When I get to #2 in that link, I’m supposed to comment out the text in wp_includes/vars.php:
    $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;

    That text is not to be found – the closest thing in that file is (WP v3.9):
    $is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false);

    And regarding #3 in the link, as mentioned mod_rewrite is already enabled.

    Not sure where to go from here.

    (The apache error log doesn’t have anything relating to this issue)

    Thread Starter CiderJack

    (@ciderjack)

    Still having this same problem.

    Also, the content of the file wp_includes/vars.php is not the same on the link provided by nabil_kadimi, so that wasn’t any help.

    Any further suggestions?

    perhaps the actual error would help narrow down the cause, try adding that to your post, did you do a google search for the error you received cause sometimes that can help with diagnosing the cause. Have you also tried rebooting your modem? temporarily disabling security software? try the steps in this article

    I hope that helps you out, I can totally relate with how frustrating these issues can be especially when the computer doesn’t really tell you why its sick, it just is if you know what I mean

    Nabil

    (@nabil_kadimi)

    Please do a backup before doing this:

    1. Go to [http://example.com/]wp-admin/network/update-core.php and re-install or update WordPress
    2. Go to [http://example.com/]wp-admin/options-permalink.php and re-save the page
    3. Come back here and answer this question:
    Do you have a .htaccess file in your website document root, i.e at the location where your index.php, wp-config.php and other WordPress files reside?

    do you have frontpage or frontpage server extensions installed?
    this looks like it might be relevant.
    Finally, A solution.

    There have been a number of threads on this issue in the support forums, and until now, no solution to the problem.

    Normally, on a Unix server with the Microsoft FrontPage Server extensions installed WordPress works just fine and you are able to edit and publish pages (with Microsoft FrontPage) — until — you make a change to the permalinks (for example to the date based kind that I like /2005/04/etc). I often suggest that type of URI to folks asking about permalinks etc, as that is the method recommended by the w3c (see http://www.w3.org/Provider/Style/URI ).

    Now, the problem is that FrontPage uses the .htaccess file (which the WordPress mod_rewrite rules must access) for its “publishing” and “web authoring” configuration. As soon as the WordPress mod_rewrite code is added to the file, two things happen — the permalinks don’t work and the Frontpage Server extensions become corrupt.

    I have tried countless ways to get around this, including trying to use rewrite rules that “ignore” the %{HTTP_USERAGENT)% used by FrontPage, to using a second AccessFilename .wpaccess to the httpd.conf file, and a host of other things, and nothing worked to allow use of FrontPage and management and use of permalinks in WordPress at the same time.

    The solution is actually simple, and I figured it out by accident.

    If you are using, or wish to use FrontPage (or if your hosting package is pre-configured that way) along with WordPress, you’ll need to take the following simple steps on your server or have your hosting company do them for you.

    Microsoft FrontPage creates the following directory
    _vti_bin
    Nested within that it creates both _vti_adm
    and _vti_aut

    In addition to in your site (or WordPress) root folder in all of those directories you will find additional .htaccess files.

    In all three of these directories AND in the root directory, at the top of ALL of the .htaccess files you simply need to add one line:
    Options +FollowSymlinks

    There may or may not already be a line in each like
    Options None

    Edit and save each .htaccess file and you’re done. Now everything works perfectly, including FrontPage, AND the permalinks of your choosing.

    Thread Starter CiderJack

    (@ciderjack)

    Hi nabil_kadimi,
    I followed your steps (with a fresh install, as I hadn’t built anything on this install yet), but now a new issue has arisen.

    I installed wp, created a database & user, then opened wp-activate.php in firefox and was greeted with a 500 error right off the bat.

    Also no, there is no .htaccess file in the wp root folder.

    @8183: No, I do not use front page, thankyou.

    As we’ve said all along…

    perhaps the actual error would help narrow down the cause

    Without knowing the actual error that you’re getting it’s impossible to diagnose what could be wrong. The error will be in your servers error logs. If you can’t find them your hosting company will be able to help.

    Thread Starter CiderJack

    (@ciderjack)

    [core:alert] [pid 1368:tid 1708] F:/WebDev/mysite/v005wp/.htaccess: RewriteEngine not allowed here

    As I said above, wp is not creating the .htaccess file. As also stated above

    Working on localhost XAMPP with mod_rewrite enabled, but also tested on a ‘live’ host with the same result.

    I should add that I’m running other (older) versions of wp on the live host without issue.

    RewriteEngine not allowed here

    It’s a server problem, Apache (or your server software) doesn’t like how the. Soemthing in your .htaccess file isn’t set right, and if there’s no .htaccess file in the site, your server is finding one that’s wrong somewhere – from the error I’d say in the folder F:/WebDev/mysite/v005wp/ so please look there.

    Thread Starter CiderJack

    (@ciderjack)

    There is no .httaccess file anywhere, not even F:/WebDev/mysite/v005wp/. When I have manually added the .htaccess file (with the following text recommended on https://codex.wordpress.org/htaccess#Basic_WP )

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

    The same error is returned.

    (In XAMPP mod_rewrite has also been enabled in conf/httpd.conf.)

    This happens both locally and on the live server where again, I have other, older versions of WP running without a problem. I do not believe this to be a server issue.

    Again – this seems potentially significant – my wp-includes/vars.php file does not match the code on http://codex.wordpress.org/Using_Permalinks#Fixing_.htaccess_Generation_Issues

    I’m using wp v3.9.1

    For some reason your server believes that there’s a .htaccess file in that folder. I have seen it happen before where it’s been there but hasn’t been visible because the server is set to ignore “hidden” files (hidden files are defined by their file name startign with the full-stop like this). I’ve missed a few of them myself thanks to incorrect settings on file and FTP browsers. All that I can say is that your server does believe that the file exists if it really isn’t there, so you’ll need to figure out why that is. That’s a server problem.

    If you think that the file at wp-includes/vars.php is not correct them re-download a new un-touched copy of WordPress and re-install that file. If there is a problem with that I’d suggest doing it with every file.. if one’s been changed somehow then there’s no telling if any others have or have not been affected as well.

    Thread Starter CiderJack

    (@ciderjack)

    @catacaustic:

    There is no .htaccess file anywhere on the local server. I have windows set to display hidden files & folders. It is not hidden.

    I have re-downloaded wp v3.9.1 MANY times, the last time was today, which when I checked does NOT match the code on that page. Perhaps the documentation is out of date? Feel free to check it again yourself, and you’ll see that it does not match.

    I’m sorry that you’re getting frustrated, but there’s really not much else that can be done.

    The same error is returned.

    Is your server still telling you that there’s an error with the .htaccess file in that directory? As that was the only error message that you’ve given us so far it’s really hard to see any other issue. If the file isn’t there, then your server has a problem and thinks that it’s there. I’m not sure what could be done about that as there’s no way for anyone here to see what’s happening on the server.

    I do admit that it is very strange that it’s happening both locally and on the live server. Unless they are exactly the same setups normally one or the other will be a problem, but not both. Again, without access to the server, that’s very hard to try and diagnose because we just don’t have any way of seeing what’s going on under the covers there.

    There is a good chance that the documentation is out of date. The codes pages are all run the same way that the forums are, by volunteers, so things can get out of date and need to be updated by people that see this. From what I’ve seen here, yes that code is out-dated, but the basis of it all is still there, and it’s only commenting out one line and adding in a line to force $is_apache to be true. That’s all pretty easy to do.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Changing permalinks causes 500 Server Error’ is closed to new replies.