Jump to content

force https


aebstract

Recommended Posts

What is the best way to force the url to an https prefix vs an http? I'm thinking mod rewrite but I can't figure out a way to do it correctly, what I currently use in my rewrite is:

 

RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([[:alnum:]_]+)/$ /index.php?page=$1 [NC,L]
RewriteRule ^([[:alnum:]_]+)/([[:alnum:]]+)/$ /index.php?page=$1&var1=$2 [NC,L]
RewriteRule ^([[:alnum:]_]+)/([[:alnum:]]+)/([[:alnum:]]+)/$ /index.php?page=$1&var1=$2&var2=$3 [NC,L] 

 

This is on an apache server, perhaps there is another way of doing this or someone knows an easy way to do it with rewrite?

Link to comment
https://forums.phpfreaks.com/topic/96181-force-https/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.