简体   繁体   English

重定向子域

[英]Redirection subdomain

I was trying now for hours to get it working but without a solution.我现在尝试了几个小时才能让它工作,但没有解决方案。

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
RewriteCond %{HTTP_HOST} ^forum\.rainingdreams\.to
RewriteRule ^(.*)$ https://rainingdreams.to/forum/$1 [R=301]

This is the .htaccess that I use.这是我使用的 .htaccess。 I have the problem, that the subdomain fetches the folder wrong.我有问题,子域获取文件夹错误。 If I enter "forum.rainingdreams.to" it will fetch "forum.rainingdreams.to/ forum /".如果我输入“forum.rainingdreams.to”将取回“forum.rainingdreams.to/论坛/”。 I just want that the subdomain will redirect it to the folder.我只希望子域将其重定向到文件夹。

Does anyone have an Idea?有没有人有想法?

You can use:您可以使用:

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
RewriteCond %{HTTP_HOST} ^forum\.rainingdreams\.to
RewriteRule ^((?!forum).*)$ /forum/$1 [L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM