I’m having a problem trying to redirect a WordPress site that is setup in a subfolder. I know how to do this when the site is in root, but using the same htaccess settings, it is adding the /subfolder/ into the url upon redirection of pages from http to https (this does NOT happen when just going to the root website).

domain.com/page – redirects to – domain.com/landing2017/page

/.htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteCond %{REQUEST_URI} !^/landing2017/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /landing2017/$1
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^(/)?$ landing2017/index.php [L] 
</IfModule>

/landing2017/.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

What am I doing wrong?

Read more here: How to redirect WordPress to https SSL with subfolder?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: