• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    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. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question exclude folder from https redirect

trensco

New Pleskian
Hello,

I activated under "Domains > example.com > Hosting Settings" the "Permanent SEO-safe 301 redirect from HTTP to HTTPS".

This works very well, but now i want to exclude a whole folder from this redirect.

I got a domain like www.mydomain.com and now i want to exclude www.mydomain/admin/* and everything after admin/ like www.mydomain.com/admin/index.php?cl=****

How i can get this work? I tried to add the line

RewriteCond %{REQUEST_URI} !^/admin/? [NC]

in the /var/www/vhosts/system/mydomain.com/conf/httpd.conf but i will be still redirected to https.

Is there any solution for my problem?

Greetings
 
Example of how to do a redirect with the exclusion of a path (in this case it is the Let's Encrypt challenge path):
Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/.well-known/acme-challenge [NC]
RewriteRule .* - [L]
RewriteRule ^(.*)$ https://<target domain>/$1 [L,R=301]
You can adapt this to your needs easily.
If you use such a rewrite rule, you need to disable the "redirect all non-SSL to SSL" setting in the control panel and rather do the redirect yourself.
 
Back
Top