• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Redirect subdomain to folder

Hi FelixB,

here you go with some working examples, how to redirect correctly, using apache:

APACHE - NON-WWW - configuration:
Code:
RewriteEngine On
RewriteCond %{SERVER_PORT} !^80$
RewriteCond %{HTTP_HOST} !^(your-domain-OR-sub.domain\.com)?$
RewriteRule ^(.*)$ http://your-domain-OR-sub.domain.com/$1 /squirrelmail [R=301,L]

APACHE - WWW - configuration:
Code:
RewriteEngine On
RewriteCond %{SERVER_PORT} !^80$
RewriteCond %{HTTP_HOST} !^(www\.your-domain-OR-sub.domain\.com)?$
RewriteRule ^(.*)$ http://www.your-domain-OR-sub.domain.com/$1 /squirrelmail [R=301,L]

APACHE - NON-WWW - configuration - HTTPS:
Code:
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTP_HOST} !^(your-domain-OR-sub.domain\.com)?$
RewriteRule ^(.*)$ https://your-domain-OR-sub.domain.com/$1 /squirrelmail [R=301,L]

APACHE - WWW - configuration - HTTPS:
Code:
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTP_HOST} !^(www\.your-domain-OR-sub.domain\.com)?$
RewriteRule ^(.*)$ https://www.your-domain-OR-sub.domain.com/$1 /squirrelmail [R=301,L]


Pls. note, that IF you nginx as well, you have to add additional directives for nginx as well!!! ;)
 
Hi UFHH01,
thx for your post but for me and my Plesk Onyx Version 17.5.3 Update-Nr. 19 only the HTTP commands works.
When i try to save the HTTPS commands i got an error:

Plesk-apache-rewriterules.png
Any ideas on that?

best regards,
Darkentik
 
Back
Top