Blog, Website & Page Publishing

Benny2
Participant

Redirect old blog URL to new domain

SOLVE

Hi,

 

I would like to do the following:

 

Source: https://info.adimec.com/blogposts/bid/36638/:post-name

Target: https://www.adimec.com/{post-name}

 

However the 36638 is different for each post. It seems to be a post id used by hubspot before 2014/2015. Can I make one general redirect rule to redirect all posts even if the id is different?

 

I tried this by looking at some systemgenerated redirect but it doesn't seem to work:

Source: http://info.adimec.com/blogposts/bid/(?P<legacy_id>[\d]+)/:post-name 

Target:  https://www.adimec.com/{post-name}

 

Thanks in advance.

0 Upvotes
1 Accepted solution
Phil_Vallender
Solution
Most Valuable Member | Diamond Partner
Most Valuable Member | Diamond Partner

Redirect old blog URL to new domain

SOLVE

Hi @Benny2

 

If I am right, a flexible URL structure should be able to strip out those unecessay and unique post ids. 


Something like this should work -

 

Source: https://info.adimec.com/blogposts/bid/:id/*rest-of-url

Target: https://www.adimec.com/{rest-of-url}

 

Hope this helps.

Phil Vallender | HubSpot Website Agency

View solution in original post

2 Replies 2
Phil_Vallender
Solution
Most Valuable Member | Diamond Partner
Most Valuable Member | Diamond Partner

Redirect old blog URL to new domain

SOLVE

Hi @Benny2

 

If I am right, a flexible URL structure should be able to strip out those unecessay and unique post ids. 


Something like this should work -

 

Source: https://info.adimec.com/blogposts/bid/:id/*rest-of-url

Target: https://www.adimec.com/{rest-of-url}

 

Hope this helps.

Phil Vallender | HubSpot Website Agency
Benny2
Participant

Redirect old blog URL to new domain

SOLVE

Thanks,

 

This works. 

 

I thought all those variables like :id, :post-name, *rest-of-url were pre-defined variables and would direct to a specific blog parameter.