最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

url rewriting - WordPress SSL (https) is not working with custom permalink

programmeradmin1浏览0评论

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
 |  Show 3 more comments

1 Answer 1

Reset to default 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.

发布评论

评论列表(0)

  1. 暂无评论