-
Add this to your httpd.conf:
SSLRequire %{HTTP_HOST} eq "www.mydomain.com"
- Or try this:
# Turn on Rewriting
RewriteEngine on
# Apply this rule If request does not arrive on port 443
RewriteCond %{SERVER_PORT} !443
# RegEx to capture request, URL to send it to (tacking on the captured text, stored in $1), Redirect it, and this is last rule.
RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R,L]
-
Append the following line to httpd.conf:
Redirect permanent / https://www.mydomain.com/
-
Or try this:
<NameVirtualHost 122.123.124.1:80>
ServerName mywebsite.com:80
ServerAlias http://www.mywebsite.com:80
ServerAlias 122.123.124.1:80
Redirect permanent / https://www.mywebsite.com/
</VirtualHost>
-
Add the following lines to .htaccess:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Make sure you have this line in your httpd.conf file:
LoadModule rewrite_module modules/mod_rewrite.so
-
Or try this:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R,L]
Note: Restart Apache for new configuration to take effect.
$ /etc/init.d/httpd restart
No comments:
Post a Comment