OT - ish :-)

Why does quickstart use:


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L] 

And the manual


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

The only difference being the / in front of index.php ... Does this make
any difference?

- Robert

-----Original Message-----
From: Matthew Weier O'Phinney [mailto:matt...@zend.com] 
Sent: 05 March 2009 14:28
To: fw-general@lists.zend.com
Subject: Re: [fw-general] .htaccess - avoid request to go to controller

-- debussy007 <debussy...@gmail.com> wrote (on Thursday, 05 March 2009,
05:42 AM -0800):
> I have a file directory, which contains .html pages, which should be 
> accessed without passing by MVC model Controller/Action.
> 
> The url looks like this:
> http://xyz.com/public/miv/files/reports/histo-report-2009-03-05.html
> 
> Currently I have the following exception with the URL above:
> Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception'

> with message 'Invalid controller specified (files)'
> 
> I tried to asdd a rule in .htaccess,
> but it doesn't resolve the problem, maybe I did something wrong ...
> 
> RewriteEngine on
> RewriteCond %{REQUEST_URI} !files/*
> RewriteRule .* index.php
> php_flag magic_quotes_gpc off
> php_flag register_globals off

Please use the recommended RewriteRules from the manual:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]

This rule basically says that if the file exists on the server, serve
it; otherwise, go to the MVC.

--
Matthew Weier O'Phinney
Software Architect       | matt...@zend.com
Zend Framework           | http://framework.zend.com/

________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs
Email Security Service and the Macro 4 plc internal virus protection
system.
________________________________________________________________________

________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email 
Security Service and the Macro 4 plc internal virus protection system.
________________________________________________________________________

Reply via email to