Advertisement:

Author Topic: [TIP] .htaccess to redirect ALL pages to https  (Read 1555 times)

p206ab

  • Sr. Member
  • ****
  • Posts: 343
[TIP] .htaccess to redirect ALL pages to https
« on: January 11, 2017, 07:30:50 pm »
There are some topics here on how to redirect http pages from your osclass website to https, but they only work on homepage, so this may be useful for many here, as the following .htaccess will redirect ALL links to https version.

Code: [Select]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>