• Resolved terry789

    (@terry789)


    Hello,

    I have a main site in my root and a subsite in a separate folder.

    When I choose this subfolder (mysite.com/subsite – without https//) in my browser, only the root folder opens. This will show https:// in front of it

    When I type in the full path, https://mysite.com/subsite it works immediately

    This is my .htaccess file

    # BEGIN rlrssslReallySimpleSSL rsssl_version[4.0.13]
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
    </IfModule>
    # END rlrssslReallySimpleSSL
    # BEGIN WordPress
    # De richtlijnen (regels) tussen "BEGIN WordPress" en "END WordPress" worden
    # dynamisch gegenereerd en zouden alleen aangepast mogen worden via WordPress filters.
    # Alle wijzigingen aan de richtlijnen tussen deze markeringen worden overschreven.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /subsite/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /subsite/index.php [L]
    </IfModule>
    
    # END WordPress

    When I delete the following data it works correctly.

    # BEGIN rlrssslReallySimpleSSL rsssl_version[4.0.13]
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
    </IfModule>
    # END rlrssslReallySimpleSSL

    Any idea?
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mark

    (@markwolters)

    Hi @terry789,

    what you could try is to edit this line:

    from

    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

    to

    RewriteRule ^(.*)$ https://%{HTTP_HOST}/%{REQUEST_URI} [R=301,L]

    you’d have to enable the ‘Stop editing the .htaccess file’ option in the Settings->SSL menu to prevent this change from being overwritten.

    Thread Starter terry789

    (@terry789)

    Hello @markwolters

    I also found that solution and it seems to work well.

    Why not make this “standard” or are there any restrictions?

    But anyway, it works, thank you!

    Best

    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    @terry789 this solution will cause issues if there are any lines before it that manipulate the url. The result is in the $1 property. The request uri would result in ignoring those lines.

    Not sure why this causes an issue in your setup, as it just redirects to https. We’ll have to look into that.

    Thread Starter terry789

    (@terry789)

    @rogierlankhorst,

    maybe good to know that there are several other domains on the same server where the original settings work well. (?)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Wrong redirect for website in subfolder’ is closed to new replies.