Support » Plugin: Redirection » redirect old .html links

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try:

    Source url: ^/(.+)/post\.html$
    Regex: ticked
    Target: /$1/post/

    Code: 301 Moved permanently

    Thanks for the reply. What I meant is that I had my blog set up as:
    http://domain.com/year/day/post-name.html
    and now it’s
    http://domain.com/year/day/post-name/

    These are just examples and the word post is not really used. How would I remove the “.html” and replace it with a “/”?

    Thanks again

    Seedsca: did you even bother to try the solution I gave you ? It *will* do what you need it to do based on the information you provided…

    Anyways, if you want to make it more specific and postname is a variable as well, try:

    Source url: ^/([0-9]{4})/([0-9]+)/(.+)\.html$
    Regex: ticked
    Target: /$1/$2/$3/
    Code: 301 Moved permanently

    If you know the allowed characters for the post-name part of the url, you can even make that bit more specific, something like [a-z0-9-]+ for instance.

    @jrf: I did try it without success. The second option worked like a charm however.

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘redirect old .html links’ is closed to new replies.