301 redirect for permalink changes on new version of site

Home Forums BulletProof Security Free 301 redirect for permalink changes on new version of site

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43446
    Jaiji
    Participant

    Hi

    I’m about to launch an updated version of an old site.

    I need to redirect old posts to the same posts (but a different permalink structure) on the new site. This is just to cover old links which my be out in the wild on other sites, or bookmarked, so they don’t get a 404.

    The permalinks structure has changed, from domain/year/month/post-title to just domain/post-title, and all post titles are the same as they were – it’s just the path that needs changed.

    I’ve had a look here but can’t see anything directly related. How would I accomplish this? I understand the rule would need to be this:

    RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://www.yourwebsite.com/$4

    or possibly this:

    RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(?!page/)(.+)$ YOUR-DOMAIN/$3

    with the domain changed to match the site but I’m not sure if that’s the correct way to add it to BPS, or which one of these to use. Please advise.

    #43447
    AITpro Admin
    Keymaster
    RedirectMatch 301 ^/\d{4}/\d{2}/(.*)/$ https://www.yourwebsite.com$1
    #43448
    Jaiji
    Participant

    Many thanks.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.