下面的域只是示例域。我想将mydomain.com/test/ (通配符)重定向到google.com/dl (通配符)
我正在使用这些代码
RewriteEngine on
RedirectMatch 301 ^/test/.*$ https://google.com/dl但是当我访问https://example.com/test/hi时,它会重定向到https://google.com/dl,而不是https://google.com/dl/hi
我该怎么做呢?谢谢
发布于 2021-01-19 14:41:17
你能不能试一下,用展示的样本写的。请确保在测试URL之前清除浏览器缓存。
RewriteEngine on
RewriteRule ^test/(.*)/?$ https://google.com/dl/$1 [R=301,NC,L]发布于 2021-01-19 14:48:14
您可以尝试,您将找到100%解决方案,您必须添加以下3行到项目的根文件夹.htaccess文件
RewriteEngine on
RewriteBase /
RewriteRule (.*) http://www.new-domain.com/$1 [R=301,L][/php]https://stackoverflow.com/questions/65786565
复制相似问题