URL rewrite to https in MVC problem

Discussion in 'Apache' started by davykiash, Apr 30, 2010.

  1. #1
    Am rather new to this world of htaccess redirects.Am trying to force all redirects in my Zend MVC to my https but I get a requested URL not found error on requests that dont go though the index controller

    Example

    https://www.example.com/auth/register
    Code (markup):
    gives a requested URL /auth/register not found error. However if I remove the https redirect rule it works fine over http. If I adjust the URL to

    https://www.example.com/index.php/auth/register
    Code (markup):
    it works fine. The URL

    https://www.example.com/index/faq 
    Code (markup):
    works just fine since it goes through the index controller.

    My .htaccess file looks like this

    RewriteEngine On
    
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
    
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
    
    <ifModule mod_gzip.c>
      mod_gzip_on Yes
      mod_gzip_dechunk Yes
      mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
      mod_gzip_item_include handler ^cgi-script$
      mod_gzip_item_include mime ^text/.*
      mod_gzip_item_include mime ^application/x-javascript.*
      mod_gzip_item_exclude mime ^image/.*
      mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>
    Code (markup):
    What do I need to adjust to get the URL

    https://www.example.com/auth/register
    Code (markup):
    working?
     
    davykiash, Apr 30, 2010 IP