[英]URL redirect in apache2 .htaccess
how can i redirect redirect url from 我如何重定向从
http://www.mydomain.com
to https://mydomain.com
http://www.mydomain.com
到https://mydomain.com
and 和
https://www.mydomain.com
to https://mydomain.com
https://www.mydomain.com
到https://mydomain.com
or all subdomain with our without https
except status.mydomain.com
to redirect to https://mydomain.com
? 还是所有没有
https
子域(除了status.mydomain.com
之外) status.mydomain.com
重定向到https://mydomain.com
?
Example: hello.mydomain.com
and https://hello.mydomain.com
to https://mydomain.com
? 例如:
hello.mydomain.com
和https://hello.mydomain.com
到https://mydomain.com
吗?
Maybe this is help you 也许这对你有帮助
Redirect 302 http://www.mydomain.com https://mydomain.com
重定向302 http://www.mydomain.com https://mydomain.com
put this code in your DOCUMENT_ROOT/.htaccess
file: 将此代码放在您的
DOCUMENT_ROOT/.htaccess
文件中:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^status\. [NC]
RewriteCond %{HTTP_HOST} ^[^.]+\.mydomain\.com$ [NC]
RewriteRule ^ https://mydomain.com%{REQUEST_URI} [NE,R=301,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.