Pico
Pico

Reputation: 331

301 Redirect reg expression in htaccess

I'm trying to redirect http://www.domain.com/post/155851321646/post-slug

to http://www.kaleandcaramel.com/post-slug

(this is actually redirecting old Tumblr URLs to Wordpress URLs)

the closest I came was this:

RewriteRule ^/?post/([0-9]+).(.*?)$ http://www.domain.com/$2 [L,R=301]

but it's not working.

Upvotes: 1

Views: 112

Answers (1)

user2493235
user2493235

Reputation:

Use this instead:

RewriteRule ^post/[0-9]+/([^/]+)$ http://www.domain.com/$1 [L,R=301]

Let me know any problems.

Upvotes: 3

Related Questions