Page 1 of 1

Zend Framework htaccess file

Posted: Tue Feb 12, 2008 5:31 am
by BornForCode
Hello, a strange situation has happened to me:

On local server the following code is working perfectly:

Code: Select all

RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
But on my test web server i have to use:

Code: Select all

RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php
Any ideas why this is happening?

Re: Zend Framework htaccess file

Posted: Wed Feb 13, 2008 1:57 am
by BornForCode
Nobody has an idea please?

Re: Zend Framework htaccess file

Posted: Wed Feb 13, 2008 2:43 am
by devendra-m
i think u should use REQUEST_FILENAME instead of SCRIPT_FILENAME

Re: Zend Framework htaccess file

Posted: Wed Feb 13, 2008 6:45 am
by BornForCode
No effect, changing the SCRIPT with REQUEST doesn't have any effect :( :banghead:

Re: Zend Framework htaccess file

Posted: Wed Feb 13, 2008 7:21 am
by shiznatix
Strange, my .htaccess file using Zend looks like this:

Code: Select all

 
RewriteEngine on
 
RewriteBase /
 
RewriteRule ^images/.*$ - [PT]
RewriteRule ^poker-forum/.*$ - [PT]
 
RewriteRule !\.(js|ico|gif|jpg|png|css|php|bmp|txt)$ index.php
 
What exactally is not working? It just does not do and forwarding?

Re: Zend Framework htaccess file

Posted: Thu Feb 14, 2008 12:11 am
by devendra-m
I am using following rules and its working. I hope it will be helpful

Code: Select all

 
RewriteEngine On
RewriteRule ^(.*)\.(.*)$     $1.$2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.(.*)$     $1.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$           error.php