• Hi,

    I Changed my permalink structure from /year/month/day/title to just /title. I setup a redirect on Bluehost however every now and then this will disappear. I think the .htaccess file gets edited or rewritten somehow. Could there be a plugin doing this?

    How do I go about finding out what’s causing the redirect to disappear?

    Thanks,
    Paul

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator t-p

    (@t-p)

    Unless you’ve done something to disable it, the built-in canonical URL feature of WordPress should have taken care of it – it will actually do the 301 redirects for you; you don’t have to do anything.

    https://markjaquith.wordpress.com/2007/09/25/wordpress-23-canonical-urls/

    You can try it out easily enough, just change the permalinks and with a browser that has it’s cache and cookies cleared (just for testing) visit one of the old URLs. You should get 301’ed to the new URL.

    Google will also respect your built in canonical URL.

    If the canonical URLs have not taken care of that, than try adding this to the top of your .htaccess file.

    Old URLs to new
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)/$ https://adwordsforstudents.com/$4/ [L,R=301]
    </IfModule>

    Then try visiting you site and see if it works.

    Thread Starter paulminors

    (@paulminors)

    That’s weird, the canonical feature didn’t seem to work for me. I don’t know how I would have disabled this, is there an option somewhere?

    With that code, am I right in thinking that if the .htaccess file gets rewritten that this part will be added to the new file?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘.htaccess Redirects’ is closed to new replies.