Redirect http to https does not work on subdir where another instance of WordPress installed

Question

I have installed two instances of WordPress, on https://www.datanumen.com/ and a subdirectory https://www.datanumen.com/blogs/

Now to make all http URL be redirected to the https version, I add the following directive in .htaccess at the root folder, as follows:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.datanumen.com/$1 [L,R=301,NC]

This works for all the URLs under the root folder, except those under /blogs/ subfolder.

I try to modify the .htaccess under /blogs/ by adding the above directive again. But that does not work. Why?

  1. I think the directive in .htaccess is inherited by subfolder, why it does not work for /blogs/?
  2. Should I change the directive to:
RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.datanumen.com/blogs/$1 [L,R=301,NC]

Actually I have tried to do so, but not working either.

Update:

Now let me provides an example to explain this more clearly:

For URL such as http://www.datanumen.com/outlook-repair/, it CAN be redirected to the https version https://www.datanumen.com/outlook-repair/ properly.

However, for URL under /blogs/ subfolder, such as http://www.datanumen.com/blogs/2-useful-methods-to-recover-outlook-data-from-a-damaged-disk-image-file, it CANNOT be redirected to the https version, instead, what you get is still the http version. That is the problem.

0
alancc 4 months 0 Answers 24 views 0

Leave an answer