URL Rewrite in htaccess problem

Posted by davykiash on Stack Overflow See other posts from Stack Overflow or by davykiash
Published on 2010-04-29T16:40:01Z Indexed on 2010/04/29 18:07 UTC
Read the original article Hit count: 315

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

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

it works fine. The URL

https://www.example.com/index/faq 

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>

What do I need to adjust to get the URL

https://www.example.com/auth/register

working?

© Stack Overflow or respective owner

Related posts about url-rewriting

Related posts about .htaccess