Page 1 of 1

Regarding the htaccess and ZF

Posted: Mon Mar 03, 2008 9:07 am
by BornForCode
Hello:

This works fine: http://house.bornforcode.com/html/
Or this: http://house.bornforcode.com/html/index/index

But this is not working: http://house.bornforcode.com/html/login/index

My htaccess file:

RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

Re: Regarding the htaccess and ZF

Posted: Mon Mar 03, 2008 9:24 am
by Sekka
I take it you want to implement what I call 'virtual' URLs?

This is the .htaccess code I use,

Code: Select all

# Fix requests for directories without last slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule (.*) /$1/ [R=301,L]
 
# 'Virtual' URL forwarding
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ index.php [L,QSA]
Then, I use $_SERVER['REQUEST_URI'] and parse it to determine what URL they were requesting and display the appropriate page.

This make sense?