Home How to redirect group of pages to one page?
Reply: 1

How to redirect group of pages to one page?

user219457
1#
user219457 Published in 2018-01-12 20:00:07Z

I am trying to redirect more than 1000 subpage to one page, I know we can redirect each page but is there any way to do this with single rules?

For example, I have this type of URL

/main-page/bla-bla/bla-bla-bla/
/main-page/bla-bla2/bla-bla-blajhj/bmnddbm/
/main-page/bla-bla3/bla-bla-blajhgj/

And so on, I want anything after /main-page/***** will redirect to /main-page/

Ben
2#
Ben Reply to 2018-01-12 21:34:14Z

Regex can help:

RewriteRule ^/?main-page/.+ /main-page/ [R=301,L]
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.353594 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO