404 pages Redirect rules

404 pages on your WordPress site when migrating to SSL

Sometimes users have the issue that all pages get 404 errors when Really Simple SSL is activated. The cause is different from user to user and from server to server.

Re-save the permalinks

Thought Really Simple SSL flushes the internal rewrite rules, it sometimes helps to do this again.  You can find the permalinks in settings/permalinks. Re-saving makes sure the WordPress rewrite rules get flushed.

Photon from JetPack

Photon uses a CDN service to speed up loading for your images. When these image paths are changed, this might lead to issues. If you see the image paths are changed into wp1.com etc,  try deactivating Photon.

.htaccess files in subdirectories

If you have .htaccess files in your media directories, remove them, or adapt them to the https domain.

Other redirecting plugins

Check also if you have a multilanguage plugin, security, caching or redirect plugins active. These especially multilanguage plugins often have strange effects when the url has changed. Deactivate them, or re-save the settings, to flush the internal redirect rules of these plugins.

Security on your server

Check if you have hot link protection activated.

NGINX server settings

If you are on NGINX, there can be a different cause. Adding the following lines to the httpd-ssl.conf file often solves the issue.

Look for  <VirtualHost *:443>  which is for the DocumentRoot, and add these lines in this section
   <Directory C:/www-base/ >
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory C:/www-base/site-dir > 
Options Indexes FollowSymLinks MultiViews 
AllowOverride All 
Order allow,deny 
allow from all 
</Directory>
Of course  “C:/www-base/” and “C:/www-base/site-dir”   are only examples… would be whatever drive letter and path are used in your own environment.

This is a typical server configuration issue, so you might have to contact your hosting provider to fix it.

Related Articles

  • Remove .htaccess redirect on site lockout

    The .htaccess is the fastest redirect, so why not enable it by default? When you enable the setting “htaccess redirect” in settings/ssl/settings, Really Simple SSL detects the most suitable redirect,...
  • Redirect rules in Nginx

    Use the following to redirect to https on nginx. server { listen 80; server_name my-domain.com; return 301 https://$server_name$request_uri; } Share Share Share Share
  • How to setup Google Analytics and Google Search Console/Webmaster Tools

    When you move your site to ssl, you have to adjust your settings in Google Analytics and Google Webmaster Tools/Search Console accordingly. It’s not much work, but it’s important you...
  • Does Really Simple SSL make my site slower?

    When you’ve activated Really Simple SSL on your site, in some cases you might notice your site has become slower. I specifically built this plugin to be fast: most of the...

6 Comments

  • Honza Johnson

    My WordPress site got recently hacked, and thousands of ‘fake’ pages are now indexed. After the fix they give a 404 so that’s good. However, I upgraded my site to SSL and now I don’t want to redirect my http:// 404 pages to https:// 404. Is it possible with .htaccess to only redirect https if the page is NOT a 404?

    Unfortunately this doesn’t work:

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_FILENAME} !404\.php$
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    RewriteBase /

    Do you have any suggestion? Thanks!

    • Rogier Lankhorst

      Hi Honza,

      I don’t see why a 404 page can’t redirect to a https 404 page. A 404 is 404, so for SEO purposes I don’t see why you would want to exclude it. Search engines will drop those pages soon enough, if the 404 comes in. But if you are sure, you could try something like:
      RewriteCond %{ENV:REDIRECT_STATUS} !=404

  • edd_user_1811042

    Hi,

    I was wondering if someone could suggest a solution here as I’m at a loss. I switched to SSL more than a month ago, followed all the steps, installed Really Simple SSL plugin, resubmitted new Sitemaps to Seach Console, all done. I disappeared from Google (which is apparently normal after switching) but now Google Search Console is showing 1.5k 404 errors on my website, as if there was something wrong with all the images I ever uploaded. But when I open every blog post all images are there and seem to be fine. I have no idea what to do. I went to Settings/Permalinks and re-saved the settings but it didn’t work 🙁

    • Mark Wolters

      Hi,

      can you give an example of a link that is working on your site but results in a 404 error in Search Console? Have you tried to let Google recrawl the site?

      Mark

  • Mudassir Ansari

    Hi,

    The above given solutions are applicable if the wp-admin is available.

    I am getting a 404 error and unable to start wp-admin panel too.

    Any solution for this issue?

    Much thanks in anticipation.

    • Mark Wolters

      Hi Mudassir,

      it sounds like there may be something going wrong on the server level, perhaps the https:// site points to a different folder on the server and therefore https:// requests result in a 404 error. If the above solutions didn’t help I’d suggest to contact your hosting provider about this issue.

      Mark

Leave a Comment