• Hi there,

    So real nightmare here.
    I was having trouble with Google Webmaster detecting a 404 error from my sitemaps.

    Apparently it was some sort of issue with my .htaccess file through my Yoast WordPress SEO plugin. This it what he suggested:

    https://kb.yoast.com/article/77-my-sitemap-index-is-giving-a-404-error-what-should-i-do

    “You should go to your .htaccess file (WordPress SEO plugin > Edit Files) and add the following code before the main WordPress rewrite rules:”

    So I added the following code (as per the link above).

    # WordPress SEO – XML Sitemap Rewrite Fix
    RewriteEngine On
    RewriteBase /
    RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
    RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
    RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
    RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
    RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
    # END WordPress SEO – XML Sitemap Rewrite Fix

    …But when I went to save the change I got a 500 internal server error and the whole site is down. Can’t even access my admin page. Disaster

    This was the original code before I added the fix.

    # 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>

    If anyone can explain what’s going on here or how to fix I would be eternally grateful.

    This what I see when I go to admin page.

    https://magicfromthemachine.com/wp-login.php?loggedout=true

    Thanks so much.
    Nick

Viewing 2 replies - 1 through 2 (of 2 total)
  • Use your ftp client and login to the site.

    Find the .htaccess file
    Rename it to htaccess.old

    Login to the blog, set your permalinks again
    That will get you closer to the fix – are you able to do that?

    Thread Starter nickmarzano

    (@nickmarzano)

    Hi Mark,

    I actually managed to fix it by finding the wordpress original .htaccess code (online) and replacing it in CPanel.

    # 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

    Back up and running although I’m still getting that 404 error from Google regarding sitemaps…Perhaps I’m following his instructions incorrectly. I presume the Apache rewrite was right for me but perhaps it’s the other one. Anyway not really sure what the sitemaps solution is but at least the site is up again;-)

    This is the 404 fix which led the whole mess in first place.

    https://kb.yoast.com/article/77-my-sitemap-index-is-giving-a-404-error-what-should-i-do

    Thanks so much for getting back to me. If you a silver bullet overwrite (or recomm) I can cut / paste into my .htaccess file that would be amazing.

    Best

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘500 Internal Server Error’ is closed to new replies.