Zend Framework htaccess file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Zend Framework htaccess file

Post 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?
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: Zend Framework htaccess file

Post by BornForCode »

Nobody has an idea please?
devendra-m
Forum Contributor
Posts: 111
Joined: Wed Sep 12, 2007 3:16 am

Re: Zend Framework htaccess file

Post by devendra-m »

i think u should use REQUEST_FILENAME instead of SCRIPT_FILENAME
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: Zend Framework htaccess file

Post by BornForCode »

No effect, changing the SCRIPT with REQUEST doesn't have any effect :( :banghead:
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Re: Zend Framework htaccess file

Post 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?
devendra-m
Forum Contributor
Posts: 111
Joined: Wed Sep 12, 2007 3:16 am

Re: Zend Framework htaccess file

Post 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
Post Reply