1

I have set up SSL on a site and the homepage is working properly.

plus every page and archives are working if the permalink settings are set to default ( Plain )

but its giving a 404 error for all pages and categories if the permalink settings are changed to another option.

I am using woocommerce plugin if that matters? plus my htaccess file looks like below.

# 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

also Page titles on all pages are not displaying correctly. its printing out domain name instead.

8
  • How did you set up the SSL? And have you tried to disable all plugins one by one?
    – Max Yudin
    Mar 8, 2017 at 19:34
  • well. i just changed the blog url and wp address to https rather then http. thats it. additionally i am on vps and ssl and https is configured correctly and working fine.
    – Anwer AR
    Mar 8, 2017 at 19:40
  • i have no somehow of htaccess but i tried several codes found from here and there but none of them works for me. images, js and css files of my site is just loading fine with https. only pages and archives are displaying 404
    – Anwer AR
    Mar 8, 2017 at 19:42
  • Can you please provide the way how do you get links to archives and pages. Navigation menus, built-in functions? Are these hard-coded in templates or somewhere else? Have you tried SSL with the default template and no plugins?
    – Max Yudin
    Mar 8, 2017 at 19:49
  • Navigation menus and functions are used to print out links. no links are hard-coded. yes i use default . there's no plugins used
    – Anwer AR
    Mar 8, 2017 at 19:51

1 Answer 1

2

Make sure mod_rewrite is enabled as Apache module. It's not needed when plain permalinks are used, but you have the opposite situation.

Also, don't lose any of incoming link juice and redirect with HTTP Status 301 everything and everybody to the HTTPS version of the site. Add to .htaccess file before (or inside) the WordPress section:

RewriteEngine On
# The following lines are essential
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

And don't forget to set up the SSL for Check Out pages in the WooCommerce settings.

5
  • thank you @Max for helping me. mod_rewrite is already enabled and that lines were added several times before too. now i have put it again into htaccess and just restarted apache. but no luck :(
    – Anwer AR
    Mar 8, 2017 at 20:49
  • i was looking at WP end but yep this was some sort of off-topic. i make it work by modifying apache .conf file :) thanks again @Max for helping me out.
    – Anwer AR
    Mar 8, 2017 at 21:07
  • If you have the access to the Apache configuration, check it again. It looks like not a WordPress fault.
    – Max Yudin
    Mar 8, 2017 at 21:08
  • Oh! simultaneous comments! Glad to help you.
    – Max Yudin
    Mar 8, 2017 at 21:08
  • @AnwerAR - you said above: " i made it work by modifying apache .conf file", what exactly did you do to the apache .conf file? I'm having the same issue - permalinks work great using http, but I get a 404 error using https.
    – Brian B
    Aug 16, 2018 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.