I still don't get it much ...
I would like to:
1. avoid using MVC for urls which contain .../files/...
2. avoid using MVC for urls which contain ....html
2. avoid using MVC for urls which contain ....csv
Where is a tutorial to achieve this ?
Thank you very much for any help ...
RewriteEngine on
RewriteCond %{REQUEST_URI} !files/*
RewriteCond %{REQUEST_URI} !csv
RewriteRule .* index.php
php_flag magic_quotes_gpc off
php_flag register_globals off
Matthew Weier O'Phinney-3 wrote:
>
> -- Robert Castley <[email protected]> wrote
> (on Thursday, 05 March 2009, 02:32 PM -0000):
>> 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?
>
> The QuickStart needs to be updated. The leading slash tells it to hit
> the index.php at the top of the document root; without it, it hits the
> index.php at the current directory where the RewriteRules are defined --
> which is a better way when potentially using an application within a
> subdirectory.
>
>
>> -----Original Message-----
>> From: Matthew Weier O'Phinney [mailto:[email protected]]
>> Sent: 05 March 2009 14:28
>> To: [email protected]
>> Subject: Re: [fw-general] .htaccess - avoid request to go to controller
>>
>> -- debussy007 <[email protected]> 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 | [email protected]
>> 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.
>> ________________________________________________________________________
>>
>
> --
> Matthew Weier O'Phinney
> Software Architect | [email protected]
> Zend Framework | http://framework.zend.com/
>
>
--
View this message in context:
http://www.nabble.com/.htaccess---avoid-request-to-go-to-controller-tp22351830p22666918.html
Sent from the Zend Framework mailing list archive at Nabble.com.