|
|||
|
Hi everyone.
I'm having some problems trying to set up Zend Framework on my pc. I'm currently on Windows using WAMP. I've got the mod_rewrite module loaded on httpd.conf: Code:
LoadModule rewrite_module modules/mod_rewrite.so The problem is that when I've got the .htaccess file like this: Code:
RewriteEngine on RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php If I try to access another controller I still have to enter index.php in the url like this: http://localhost/site/index.php/controller When I change the .htaccess file to: Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
I hope someone can help me. Thanks |
|
|||
|
Well for anyone interested, i found the solution.
You have to add the line: Code:
RewriteBase /aliasname Where "aliasname" is the name you gave to the Apache alias, like if you have this: Code:
Alias /cartazleiria/ "d:/workspace/cartazleiria/public/"
<Directory "d:/workspace/cartazleiria/public/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
Code:
RewriteEngine on RewriteBase /cartazleiria RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php |
|
||||
|
Another solution is to make sure that in your http.conf file, Virtual Host specified should have the AllowOverride rule set to 'All' and not 'None' with that the your URL should now work as http://domain/controller/action. This will still work though http://domain/index.php/controller/action even this http://domain/index.phpcontroller/action - All pointing to the same page!!
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|