• Resolved thedevplayer

    (@thedevplayer)


    As I had been enduring some performance/load issues since activating Really Simple SSL, I wanted to try the .htaccess redirect option.

    I recently activated that feature, and it seemed to work smoothly. I wasn’t locked out of anything, and my pages were all loading (and a bit faster than they were on wpredirect).

    However, I noticed a potential problem:

    If I type the direct link to a page that isn’t in the root directory (such as articles, or the WP-ADMIN) using the https:// protocol, it is not redirecting me correctly.

    My wordpress is setup as follows:

    domain.com/wpdirectory/ (so the admin is at domain.com/wpdirectory/wp-admin, etc)

    Now, when I type https://domain.com/wpdirectory/wp-admin it tries to redirect me to https://domain.com/wp-admin

    The same happens for articles. It’s trying to drop the “wpdirectory” part of the string.

    For additional context:

    I have a 301 redirect that goes from domain.com to domain.com/wpdirectory. That didn’t cause any problems when I was using wpredirect, but maybe it conflicts with the htaccess option?

    Please lt me know what I can do here.

    • This topic was modified 6 years, 5 months ago by thedevplayer.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    You can try moving your custom redirect after the Really Simple SSL redirect

    The Really Simple SSL redirect redirects to the https version of requested URL.

    Alternatively, you can try this redirect:

    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] 

    As REQUEST_URI changes as the different RewriteRules within the .htaccess file are applied by Apache.

    Thread Starter thedevplayer

    (@thedevplayer)

    I actually deleted and re-created my domain.com -> domain.com/wpredirect after activating htaccess in Really Simple SSL, as I was getting a redirect loop otherwise. So that isn’t the issue.

    Regarding the code you recommended – a bit confused. Would I put that in htaccess manually?

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Yes, deactivate the Really Simple SSL .htaccess redirect, and try the other one.

    They both redirect from http request to https request, so both won’t actually change the URL (other than the “s”), but the other redirect takes rewrites of the .htaccess into account. The rewrite from RSSSL just redirects from http to https, which in your particular case seems not to work in combination with another rewrite.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Direct Links Broken After Switching To htaccess Redirect’ is closed to new replies.