2

I want to redirect the url if it contains the string like /blog/abcd.../ to blog listing page i.e. /blog page. I used a to code in htaccess file.

Redirect 301 /blog/abcd http://www.example.com/blog

But the browser says Too many redirect error. I think Wordpress also do a redirection for blog single post that is /blog/abcd to /abcd. Can we force htaccess to do redirect if url contains /blog/ to blog listing page.

2 Answers 2

0

A URL like /blog/abcd.../ will redirect to the 404 page, you can redirect the 404 page to the blog page, This plugin will do what you want.

0

I have done it by the following code

RewriteRule  /blog/([A-Za-z0-9-]+)/  http://www.example.com/blog  [NC,L]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.