.htaccess 使用htaccess使用wilcards从一个位置重定向

.htaccess 使用htaccess使用wilcards从一个位置重定向,.htaccess,.htaccess,我需要有关如何在文件夹和任何子文件夹被重定向到新url时使用htaccess的帮助 示例:http:www.mysite.com/events/a-name-of-an-event(a-name-of-an-event)会有所不同 到 http:www.mysite.com/fixtures/您可以在文档的根目录中使用重定向匹配指令。htaccess文件: RedirectMatch 301 ^/events/ /fixtures/ 或使用mod_rewrite: RewriteEngine

我需要有关如何在文件夹和任何子文件夹被重定向到新url时使用htaccess的帮助

示例:http:www.mysite.com/events/a-name-of-an-event(a-name-of-an-event)会有所不同


http:www.mysite.com/fixtures/

您可以在
文档的根目录中使用
重定向匹配
指令。htaccess
文件:

RedirectMatch 301 ^/events/ /fixtures/
或使用
mod_rewrite

RewriteEngine On
RewriteRule ^events/ /fixtures/ [L,R=301,NC]