0

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?

Lost
  • 3
  • 3

1 Answers1

0

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]
Croises
  • 18,302
  • 4
  • 25
  • 45
  • Hi, well, then I get redirected to rainingdreams.to not to the subdomain. Thanks for your help. – Lost Dec 08 '19 at 21:24
  • Sorry, I did not understand that it did not work at all. What you want is a rewrite, not a redirect. I correct. – Croises Dec 09 '19 at 07:24