0

little intro:

I have SSL cert for specific domains (example.com, info.example.com, intranet.example.com, ...)

All domains except the info.example.com are running on Apache. info.example.com is running on windows server.

My problem
All sites are fully working, but I have problem with info.example.com which I dont want to server as "HTTPS" (yet). But I do have a permanent redirect in my VirtualHosts... and that makes the problem -> when I visit info.example.com, it redirect me to https://info.example.com which I don't want to. If I delete permanent redirect it will works, but I don't want to serve anything via http on my example.com.

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot "/var/www/html"
     ServerName example.com
     Redirect permanent / https://example.com/
    <Directory "/var/www/html">
        Options -Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

I wouldn't even ask here, because it must be something really stupid, but I'm struggling with this too long.

Excuse my english.

2
  • All domains except the info.example.com are running on Apache. info.example.com is running on windows server. So info.example.com doesn't run on Apache ? you should correct this, else your question doesn't have any meaning. And the (Apache) configuration you posted is about example.com and not info.example.com as you are asking. You should open your 2 eyes instead of using only one in your pyramid fingers.
    – Froggiz
    Dec 9, 2015 at 13:57
  • I don't have access to windows server for info.example.com and since it doesn't run on apache I don't even know it it's possible to manage virtualhost for this. I guess, I'm asking really wrong - consider me as "newbie"-, but i just want to exclude info.example.com from serving via https. and I've noticed that when I delete permanent redirect in my example.com it's working, so I though there could be something like permanent redirect only to www.example.com domain and not redirect whole second level domain - example.com
    – Kailo
    Dec 9, 2015 at 14:02

1 Answer 1

0

If what you are saying is true, just replace

Redirect permanent / https://example.com/

by

RewriteEngine on 
Rewritecond %{HTTP_HOST} !^info\.example\.com
RewriteRule (.*) https://example.com/$1 [R=301,L]

and don't forget to enable mod_rewrite (a2enmod rewrite)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .