【发布时间】:2021-01-06 06:47:52
【问题描述】:
我想重定向
it.example.com/it 到 .htaccess 中的 https://example.com/it
我该怎么做? 我用过这个
RewriteCond %{HTTP_HOST} ^it.example.com/it
RewriteRule ^(.*)$ https://example.com/it/$1 [R=301,L]
但是没有用。
我在它的目录中使用了另一个 .htaccess 文件。它的内容是
RewriteBase /it/
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]]
【问题讨论】:
标签: .htaccess redirect mod-rewrite url-rewriting