dimanche 22 janvier 2017

Force user to use https:// + www

The target is the subdomain tc.gamingprouk.net and it is using valid SSL. I want .htaccess to add not only https:// or www., I want both of them! Like http://ift.tt/2k3gOp2. This is what my .htaccess contains:

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^tc.gamingprouk.net [NC]
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ http://ift.tt/2jbGgdJ [R,L]
# Hiding file extensions
Options +MultiViews

RewriteEngine on

# For .php, .html & .shtml URL's:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^([^\.]+)$ $1.html [NC,L]
RewriteRule ^([^\.]+)$ $1.shtml [NC,L]

Here is the problem:
Case 1:
User navigates to -> tc.gamingprouk.net
Htaccess rewrites to -> http://ift.tt/2k34NQm
The problem: There is no www.!
Case 2:
User navigates to -> http://ift.tt/2jbQgUh
Htaccess does nothing!
The problem: It is without https!
Case 3:
User navigates to -> http://ift.tt/2k3gOp2
Htaccess rewrites to the same
The problem: Only in this case it is with both https:// and www.

Please help! I have tryed everything, nothing is working!




Aucun commentaire:

Enregistrer un commentaire