Php 如何编写htaccess规则重定向所有url';包含页面斜杠之间的文本的

Php 如何编写htaccess规则重定向所有url';包含页面斜杠之间的文本的,php,.htaccess,url,Php,.htaccess,Url,如何编写htaccess规则来重定向斜杠之间包含sometext单词的所有url 例: 所有这些都需要重定向到单个页面 提前感谢您的帮助。试试这个: RedirectMatch ".*\/sometext(.*?)\/" "http://www.example.com/page-to-be-redirected" 只是: RedirectMatch ".*\/sometext(.*?)\/" "http://www.example.com/page-to-be-redirected" Rew

如何编写htaccess规则来重定向斜杠之间包含sometext单词的所有url

例:

所有这些都需要重定向到单个页面

提前感谢您的帮助。

试试这个:

RedirectMatch ".*\/sometext(.*?)\/" "http://www.example.com/page-to-be-redirected"
只是:

RedirectMatch ".*\/sometext(.*?)\/" "http://www.example.com/page-to-be-redirected"
RewriteRule ^sometext/ /page.htm [R=301]