Link to home
Create AccountLog in
Avatar of GCI_SUPPORT
GCI_SUPPORT

asked on

ssl and website

i have a website at www.mywebsite.com.  i have created a sub domain for my customer to access informations

at secure.mywebsite.com.

i want my user to be able to just use

https://secure.mywebsite.com

there is a way to redirect someone that goes to http://secure.mywebsite.com
ASKER CERTIFIED SOLUTION
Avatar of tkuther
tkuther

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of GCI_SUPPORT
GCI_SUPPORT

ASKER

here my conf

<VirtualHost *:80>
    ServerAdmin webmaster@gcilogistics.net
    DocumentRoot "C:/WWW/GCISECURE/GCISECURE_WEB/"
    ServerName secure.gcilogistics.net
    ErrorLog "logs/gcionlineservices.gcilogistics.net-error.log"
    CustomLog "logs/gcionlineservices.gcilogistics.net-access.log" common

<Directory C:/WWW/GCISECURE/GCISECURE_WEB/>
Order allow,deny
Allow from all
AddType text/cache-manifest .manifest
</Directory>
<Files GCISECURE>
ForceType application/WebDev16-awp
Allow from all
</Files>
Alias /GCISECURE_WEB/ "C:/WWW/GCISECURE/GCISECURE_WEB/"
</VirtualHost>

how do i have to change it
Do you have a separate vhost for :443?

The below config should work for :80 in either case.
<VirtualHost *:80>
    ServerAdmin webmaster@gcilogistics.net
    ServerName secure.gcilogistics.net

    # we redirect anything here to https://
    RewriteEngine On
    RewriteRule  ^(.*)  https://secure.gcilogistics.net$1 [R=301]
</VirtualHost>

<VirtualHost secure.gcilogistics.net:443>
    ServerAdmin webmaster@gcilogistics.net
    ServerName secure.gcilogistics.net

    # All other config goes here

    ErrorLog "logs/gcionlineservices.gcilogistics.net-error.log"
    CustomLog "logs/gcionlineservices.gcilogistics.net-access.log" common

   <Directory C:/WWW/GCISECURE/GCISECURE_WEB/>
      Order allow,deny
      Allow from all
      AddType text/cache-manifest .manifest
   </Directory>
   <Files GCISECURE>
      ForceType application/WebDev16-awp
      Allow from all
   </Files>
   Alias /GCISECURE_WEB/ "C:/WWW/GCISECURE/GCISECURE_WEB/"

  # SSL settings here
  # ...
</VirtualHost>

Open in new window

Avatar of Linux Guru
Go to the secure sub directory and create a .htaccess with the following contents.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Open in new window