Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Force http to https : not working |
|
Author |
|
Gauravsinghpost
Joined: 24 Apr 2016 Posts: 5 Location: India
|
Posted: Tue 26 Apr '16 7:59 Post subject: Force http to https : not working |
|
|
working with https but not with http http://my.abcgameservers.com/multicraft/index.php?r=site/page&view=home
This is in my config file that is 000-default.config file
Code: |
<VirtualHost *:80>
ServerName my.abcgameservers.com
ServerAlias SSL
DocumentRoot /var/www/html
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorLog ${APACHE_LOG_DIR}/error.log
RewriteEngine on
RewriteRule .* https://my.abcgameservers.com/multicraft/index.php?r=site/page&view=home [NC,R,L]
</VirtualHost>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName my.abcgameservers.com
ServerAdmin root@151.80.108.75
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateKeyFile /etc/ssl/private/server.key
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCACertificateFile /etc/ssl/certs/cab.crt
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
<Directory /var/www/html>
#If all else fails, this will ensure nothing can get in without being encrypted.
SSLRequireSSL
</Directory>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 26 Apr '16 11:03 Post subject: |
|
|
In the port 80 vhost
Code: |
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
|
|
|
Back to top |
|
Gauravsinghpost
Joined: 24 Apr 2016 Posts: 5 Location: India
|
Posted: Tue 26 Apr '16 18:53 Post subject: |
|
|
got it , thanks, working |
|
Back to top |
|
|
|
|
|
|