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.
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.
Share Improve this question asked Mar 8, 2017 at 19:13 Anwer ARAnwer AR 1,00711 silver badges19 bronze badges 8- How did you set up the SSL? And have you tried to disable all plugins one by one? – Max Yudin Commented 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 Commented 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 Commented 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 Commented 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 Commented Mar 8, 2017 at 19:51
1 Answer
Reset to default 2Make 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.