[英]Redirect www.domain.com/112 to www.domain.com/ using htaccess 301 redirect
I have thousands of URLs on my website like: 我的网站上有数千个网址,例如:
www.domain.com/112
and www.domain.com/113
www.domain.com/112
和www.domain.com/113
I'd like to redirect these straight to www.domain.com
. 我想直接将这些重定向到
www.domain.com
。
Can someone explain how I do this using the 301 Redirect with htaccess? 有人可以解释如何将301重定向与htaccess一起使用吗?
Thank you 谢谢
RewriteEngine on
RewriteRule ^(\d+)/?$ / [R=301,L]
This will redirect any digit-based request in document root to index page 这会将文档根目录中任何基于数字的请求重定向到索引页面
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.