seedsca
Member
Posted 3 months ago #
I used to host my blog with blogger and have switched to wordpress. The link structure is identical except the old posts end with /post.html and the new ones end with /post/
Any help on writing a regular expression to redirect all these at once?
Thanks and great work
http://wordpress.org/extend/plugins/redirection/
Try:
Source url: ^/(.+)/post\.html$
Regex: ticked
Target: /$1/post/
Code: 301 Moved permanently
seedsca
Member
Posted 2 months ago #
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.
seedsca
Member
Posted 2 months ago #
@jrf: I did try it without success. The second option worked like a charm however.
Thank you