Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-16-2008, 03:20 PM
Junior Member
 
Join Date: May 2008
Posts: 2
Default Trouble setting Zend Framework on WAMP!

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
I'm using the default file structure, with an ALIAS on APACHE so that when I enter the URL http://localhost/site/ I acess the public directory containing the bootstrap index.php.

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
It throws bad request when I go to http://localhost/site/ and I can only see my page if i enter index.php after that, and this shouldn't be happening with the rewriting of the URLs.
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
The indexcontroller works as it should when I go to http://localhost/site/, but if I try to go to other controllers it only works if I enter http://localhost/site/index.php/controller on the URL...

I hope someone can help me.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-19-2008, 10:59 PM
Junior Member
 
Join Date: May 2008
Posts: 2
Default

Well for anyone interested, i found the solution.

You have to add the line:

Code:
RewriteBase /aliasname
to the .htaccess file.

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>
the .htaccess file will be:

Code:
RewriteEngine on
RewriteBase /cartazleiria
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-22-2008, 11:22 PM
dele454's Avatar
Member
 
Join Date: Jun 2008
Posts: 40
Default

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!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:03 AM.