CodeIgniter Forums

Full Version: SSL in .htaccess = ERROR 404
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I use .htaccess to HTTPS, but i recive error 404. Why?
Here is my code:
<IfModule mod_rewrite.c>
  RewriteEngine On
  # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
  #  slashes.
  # If your page resides at
  # then use
  # RewriteBase /mypage/test1/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]

  RewriteCond %{HTTPS} !=on
  RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

<IfModule !mod_rewrite.c>

  ErrorDocument 404 /index.php
forcing ssl should occur before the other rewrite rules.
I do it like this:

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]