Viewing 5 replies - 1 through 5 (of 5 total)
  • Most webhosts will redirect all HTTPS requests to the public_html (or the docroot of the website you installed the SSL first) by default.

    It seems you’re using a custom redirection rule to force HTTPS. So your scenario is a bit complicated. But basically, you need to improve the ssl redirection rule you use, to avoid it happening on nolazydays.com domain.

    If you have difficulties with that, let me know how you’re doing the redirection (copy the rule here).

    Thread Starter matt_w

    (@matt_w)

    Thanks for the response. Below is from my .htaccess file. Let me know if this does not contain the redirect rule you were thinking of.

    ‘<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://everythingwellness.com/$1 [R,L]
    </IfModule>

    # BEGIN WordPress
    RewriteEngine on
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress’

    Plugin Author Ron Rennick

    (@wpmuguru)

    The reason it’s redirecting to the main site is this block in your .htaccess

    '<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://everythingwellness.com/$1 [R,L]
    </IfModule>

    Use this instead:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?everythingwellness.com
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://everythingwellness.com/$1 [R,L]
    </IfModule>

    It will perform the HTTPS redirection only for the main domain and the mapped one should work as expected.

    Thread Starter matt_w

    (@matt_w)

    That worked. Thanks to both of you for the help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘redirecting to main site instead of subdirectory’ is closed to new replies.