• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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