views:

40

answers:

1

Domain redirects from http to https in my htaccess file, but none of my urls and folders will redirect from http to https. Example: www.example.com/example.html or www.example.com/folder/example.html will not redirect from http to https

What is the rewrite rule for the htaccess file to redirect all urls and all folders from http to https?

A: 
# add trailing slash to directories and force SSL
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} !(/$) 
RewriteCond %{SERVER_PORT} 80 
RewriteRule (.*) https://www.example.com/$1/ [R=301,L]

# And for the files
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

That's what we have

Matt S
It worked.Thanks
starlight22