• need to redirect all posts in this format…

    example.com/post/1234567/sample-post

    to

    example.com/sample-post

    anyone?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Are the numbers static length or just anything?

    RewriteRule ^/post/(.*)/(.*)$ http://example.org/$2 [L,R=301]

    That’s not very clean, though,. You probably want to change the first (.*) to something that can be any number instead.

    Thread Starter Turntable

    (@turntable)

    i believe the numbers are 10 in length maybe ([0-9]+).*$/(.*)$

    what do you think

    Thread Starter Turntable

    (@turntable)

    nothing i try seems to work

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Are they ALL 10 digits?

    Cause if so…

    RewriteRule ^/post/([0-9]{10})/(.*)$ http://example.org/$2 [L,R=301]

    I use something similar to remove the YYYY/MM/DD from old links.

    Thread Starter Turntable

    (@turntable)

    still not working for some reason. could it be because im only using %postname% as the slug?

    could you post your rewriterule that you use for your site so I can get a better idea

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