Redirection subdomain

43 Views Asked by At

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?

1

There are 1 best solutions below

2
On BEST ANSWER

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]