.htaccess htaccess 301使用通配符重定向到单个页面
我们接管了一个网站,在htm中完成的旧站点根目录中有大约1万亿个页面,需要注销。我想使用通配符从页面重定向到新站点根目录中的index.php。页面命名结构的示例如下:.htaccess htaccess 301使用通配符重定向到单个页面,.htaccess,redirect,.htaccess,Redirect,我们接管了一个网站,在htm中完成的旧站点根目录中有大约1万亿个页面,需要注销。我想使用通配符从页面重定向到新站点根目录中的index.php。页面命名结构的示例如下: oldpage_dees.htm oldPage_dat.htm oldPage_deeudderting.htm 等等。如上所述,我需要将它们重定向到根目录中的index.php。通过这里的示例和讨论,我尝试了: RewriteEngine On RewriteRule ^/oldpage_([\w]*).htm$ /ind
oldpage_dees.htm
oldPage_dat.htm
oldPage_deeudderting.htm
等等。如上所述,我需要将它们重定向到根目录中的index.php。通过这里的示例和讨论,我尝试了:
RewriteEngine On
RewriteRule ^/oldpage_([\w]*).htm$ /index.php [R=301,L]
但我有一个404错误
有什么建议吗?提前谢谢 由于
.htaccess
是目录级配置文件,您不需要指定正斜杠,我认为这将完成以下工作:
RewriteEngine On
RewriteRule ^oldpage_([\w]*).htm$ index.php [R=301,L]
同时,您可以使用以下方法调试重写规则。作为
。htaccess
是目录级配置文件,您不需要指定正斜杠,我认为这可以完成此工作:
RewriteEngine On
RewriteRule ^oldpage_([\w]*).htm$ index.php [R=301,L]
同时,您可以使用以下命令调试重写规则