• Resolved granite

    (@granite30485)


    Hi,

    Thanks in advance for any help with this!

    I have 2 WordPress installs (blog and main), which means I have 3 htaccess files (blog, main, public).

    Problem:

    https://site/blog/post
    redirects wrong to:
    https://site/post

    I’ve tried all three methods to get it to redirect correctly:
    1. WordPress 301 redirection to SSL
    2. 301 .htaccess redirect
    3. Javascript redirection to SSL

    This is a serious problem because it ruins all of my backlinks. Look forward to any advice! Thanks!

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Hi @granite30485,

    The link you posted here seems to redirect correctly. Can you post a link where the link does have this problem?

    Thread Starter granite

    (@granite30485)

    Hi, please test that link again.

    https://patternbasedwriting.com/elementary_writing_success/how-to-improve-your-students-vocabulary/

    You were correct! That link did work correctly. As I tried to figured out the problem earlier, I switched both redirects back to “WordPress 301 redirects” and removed the “htaccess redirect.” That clearly fixed the problem.

    I just tested both, and when I do the “htaccess redirect” on the blog the problem reappears.

    You can test it now and it doesn’t work because I put in on the htaccess redirect.

    Earlier, I figured it was probably a htaccess conflict and that this line was the problem and I tried a couple solutions, but none worked.

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

    If you have a solution, I may try the “htaccess redirect” again. If not, I guess I will stick with the “WordPress 301 redirects”

    Please let me know. Thanks!
    =====================================================
    UPDATE:
    That’s strange. When I clicked on the link I just posted it worked and then I tested it again and it didn’t. I’ve been testing out a few different link on my blog in different browsers and it doesn’t work.

    I had seen it work correctly and then incorrectly before, but I thought it was a fluke. Now it’s not working again.

    NOTE: It’s all the pages on my blog, not just that one.

    • This reply was modified 4 years, 6 months ago by granite.
    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Can you try instead of the line above this redirect?

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

    Thread Starter granite

    (@granite30485)

    Once again, I had thought that I had seen it work and then immediately not work. Well, I put in the code and tested it on several browsers. It worked. And then it didn’t work.

    I started testing it in Incognito versions in all my browsers and it worked in all versions.

    Then if I right click the POSTED link in Chrome and “open in new window” it didn’t work. If I right click it and open it in “new incognito window” it does work.

    I decided to delete my entire browsing history (files, cookies, etc.) in regular Chrome and it started to work.

    Any insights? I’ll keep my eye on it. Thanks for your help.

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    I think your browser remembered the 301 redirect, and you now cleared this by clearing your cache.

    Thread Starter granite

    (@granite30485)

    Yes, it does seem that Chrome stores 301 redirects, so that was it. Thanks!

    When I update the plugin, will it write over that custom code in the htaccess? Will I need to add that custom code back in every time I update? Please let me know. Thanks. (I will be marking this as RESOLVED!)

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    You can enable the option “stop editing the .htaccess”. That will prevent any future edits.

    Thread Starter granite

    (@granite30485)

    I did that before I asked that question and got the following message. I just tried it again and got the same message: “You do not have a 301 redirect to https active in the settings. For SEO purposes it is advised to use 301 redirects. You can enable a 301 redirect in the settings. View settings page.”

    I had to remove the setting both times and had to go back to re-edit the htaccess.

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Alternatively you can add

    define('RLRSSSL_DO_NOT_EDIT_HTACCESS', true);

    To your wp-config.php, which also blocks .htaccess editing.

    Thread Starter granite

    (@granite30485)

    Thanks for your help. Nice support! I’ll take a closer look at all of your plugins.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Blog Directory Redirects to Root Directory’ is closed to new replies.