简体   繁体   中英

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. I have the problem, that the subdomain fetches the folder wrong. If I enter "forum.rainingdreams.to" it will fetch "forum.rainingdreams.to/ forum /". 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]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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