Google Search Console 404
-
My blog at http://juliabuckleyfitness.com/fitnessblog/
Doesn’t appear on google searches, so I tested it with URL Inspection in Google Search Console and the results were:
URL is not available to google
Page fetch Failed: Not found (404)However, the page loads fine on all devices.
A few months ago I changed the permalink – originally it was /blog/ now it is /fitnessblog/
I changed in the wordpress page editor.
Now I have a redirect from the old url to the new one.I guess this is probably causing the issue but I don’t know how to fix it.
Thanks in advance for the help 🙂
The page I need help with: [log in to see the link]
-
Your server is sending a 404 status header despite the fact it’s serving WP content. Visit the permalinks settings screen and verify the settings are correct. Just visiting will cause the rewrite rules to be regenerated, which may solve the issue by itself.
Also examine the .htaccess file in public root for any rules that might cause erroneous status headers to be sent. Also ensure the WP rules in .htaccess are correct. Correct examples can be found by searching if you are not sure.
If that checks out, deactivate all plugins and switch to a twenty* theme. You can verify the status sent by using the network developer tool of your browser. In this state, the server should be sending 200 status headers. If not, you should contact your host for assistance. If you get 200 in this state, restore your theme and plugins, one at a time, checking status after each activation. When the 404 returns, the last activated module is the cause.
Thanks @bcworkz
The issue is only with the http://juliabuckleyfitness.com/fitnessblog/
Some other pages are also sending errors but the homepage at http://juliabuckleyfitness.com (and https://juliabuckleyfitness.com) is fine.
I already tried checking the permalinks – I didn’t change anything but clicked ‘save changes’ because I read that this may help but it didn’t.
I’ve tried disabling all plugins and it doesn’t seem to help.
I’ve also tried switching to 2019 theme.
However, I have found something odd in the .htaccess file.
I’m not a pro developer and I don’t understand what’s in the .htaccess file but I can see several mentions of Drupal. This must a legacy from a previous site I had on the same server which was on Drupal (obviously my current site is WordPress).
This file is in the public.html folder not the juliabuckleyfitness.com folder (which has another .htaccess file which I think looks standard from what a google search is telling me).
Could this old .htaccess file in the public.html folder be causing a conflict?
If so, is there a standard template for this file I could replace it with?
-
This reply was modified 6 years, 7 months ago by
Julia_B.
The .htaccess in public root is the correct file. Make a backup copy of it for safe keeping. Remove all rules from the version on the server except for the portion delimited by WordPress comments. If that does not solve the 404 issue, you may as well restore the original file. If the 404s go away, copy back portions of the original you think you still want. Certain rules occur in blocks and need to be copied as a block. It’s usually clear what constitutes a block.
Copy over portions in small chunks, testing after each modification. If your site returns 500 errors, there was a syntax error in the file, so revert your last change.
I should have mentioned that when testing without plugins etc., that you should do a hard page refresh or browser cache flush for each test. Simply reloading the page is often not adequate.
Thanks @bcworkz
Strangely, I can’t see any reference to wordpress in the .htaccess file.
I’ve pasted the full contents below.
Should I try replacing it with a generic version of the file?
I really appreciate the help 🙂
#php_value memory_limit 64M
#php_value upload_max_filesize 30M
#php_value post_max_size 30M#php_value mysql.connect_timeout 120
#
# Apache/PHP/Drupal settings:
## Protect files and directories from prying eyes.
<FilesMatch “\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$”>
Order allow,deny
</FilesMatch># Don’t show directory listings for URLs which map to a directory.
Options -Indexes# Follow symbolic links in this directory.
Options +FollowSymLinks# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
# There is no end quote below, for compatibility with Apache 1.3.
ErrorDocument 404 “The requested file favicon.ico was not found.
</Files># Set the default handler.
DirectoryIndex index.php# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule># PHP 4, Apache 2.
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule># PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule># Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600<FilesMatch \.php$>
# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off
</FilesMatch>
</IfModule># Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on# If your site can be accessed both with and without the ‘www.’ prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the ‘www.’ prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the ‘www.’ prefix,
# (http://example.com/… will be redirected to http://www.example.com/…)
# adapt and uncomment the following:
RewriteCond %{HTTP_HOST} ^fitnessrocks\.co.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ http://www.fitnessrocks.co.uk/$1 [L,R=301]
#
# To redirect all users to access the site WITHOUT the ‘www.’ prefix,
# (http://www.example.com/… will be redirected to http://example.com/…)
# uncomment and adapt the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /# Rewrite URLs of the form ‘x’ to the form ‘index.php?q=x’.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule># $Id$
AuthName “Fitness Rocks live site”
AuthUserFile “/home/fitnessr/.htpasswds/public_html/passwd”<Files 403.shtml>
order allow,deny
allow from all
</Files># php — BEGIN cPanel-generated handler, do not edit
# Set the “ea-php70” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php70 .php .php7 .phtml
</IfModule>
# php — END cPanel-generated handler, do not editUpdate:
It looks like I have fixed the current issue!
I deleted the .htaccess file in the juliabuckleyfitness.com folder and created a new one by clicking Save in permalinks settings and now the 404 errors seem to have stopped.
I’m really pleased about this 🙂
I’m now just unsure what to do about .htaccess file in the public.html folder. I’ve deleted it for now but kept a back-up in case it causes any issues. Everything seems to be working OK so far.
But there was a lot in the htaccess file which was in the public.html folder that doesn’t appear in the new one I created in the juliabuckleyfitness.com folder. As you can see above it was quite long.
So I’m a bit concerned about this.
Do you have any advice please?
Awesome! Most of the original .htaccess looks harmless enough. Except for the Drupal bit as you believed all along. Remove the part starting with
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
and below all the way down toRewriteRule ^(.*)$ index.php?q=$1 [L,QSA] </IfModule>The rest appears safe to copy above the WP portion.
Thanks so much for the help @bcworkz
🙂 -
This reply was modified 6 years, 7 months ago by
The topic ‘Google Search Console 404’ is closed to new replies.