.htaccess htaccess即';s重定向一个';它已经不存在了
我想将不存在的整个文件夹重定向到主页 我尝试:.htaccess htaccess即';s重定向一个';它已经不存在了,.htaccess,.htaccess,我想将不存在的整个文件夹重定向到主页 我尝试: RedirectMatch 301 ^/folder_thats_no_longer_exists/$ / RedirectMatch 301 ^/folder_thats_no_longer_exists / RedirectMatch 301 /folder_thats_no_longer_exists / 但这种解决方案不起作用: 事实上,在尝试之后,URL仍然是:但是带有主页的内容(这会导致显示错误) 我只想: 这与301重定向有关 谢谢
RedirectMatch 301 ^/folder_thats_no_longer_exists/$ /
RedirectMatch 301 ^/folder_thats_no_longer_exists /
RedirectMatch 301 /folder_thats_no_longer_exists /
但这种解决方案不起作用:
事实上,在尝试之后,URL仍然是:但是带有主页的内容(这会导致显示错误)
我只想:
这与301重定向有关
谢谢 您可以在站点根目录顶部使用此规则。htaccess:
RedirectMatch 301 ^/folder_thats_no_longer_exists(/.*)?$ /
在测试此更改之前,请记住完全清除浏览器缓存