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


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 06-02-2008, 09:30 PM
Junior Member
 
Join Date: Jun 2008
Posts: 1
Angry 403 Error when posting a form to a controller other than IndexController

Whenever I try to post a form from a controller other than to any url other than '/' I get a 403 error (in Fiddler or Firebug) and then the $_POST array is empty. So for example the url I'm trying to post to is '/admin/', but the $_POST array is always empty unless I post the form to '/' or to an actual filename. I can't imagine that I'm the only person who's ever run into this issue. Please help!!!

Here's my .htaccess file:

RewriteEngine On
RewriteBase /
Options +FollowSymLinks

RewriteCond %{REQUEST_FILENAME}% !-f
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
  #12 (permalink)  
Old 06-05-2008, 01:31 AM
Junior Member
 
Join Date: Jun 2008
Posts: 2
Default

I'm having the same problem here. .htaccess:

Code:
RewriteEngine on
RewriteBase /
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
Controller is in AccountController.php (same dir as IndexController.php):

Code:
class AccountController extends Zend_Controller_Action {
    public function indexAction() {
    $this->view->title = "User profile";
  }
  ...<more actions here>...
}
Things work fine with the index controller. /index/test works fine, for example. But AccountController doesn't. /account/login gives me a 404, for instance.

Since /index/<action> is working, this seems to indicate that the rewrite is working, right? What else could be going on? It's driving me nuts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 06-05-2008, 01:48 AM
Junior Member
 
Join Date: Jun 2008
Posts: 2
Default

Never mind, fixed it. Problem with my apache configuration, turns out rewrite wasn't working at all. If anyone stumbles across this later and needs a tip in setting up Apache, this ubuntu thread helped me out:

mod_rewrite - Ubuntu Forums

In my case, I had mod_rewrite turned off, but even after turning it on it wasn't working. I finally figured out that it was because I was running my ZF app in a subdirectory. So I had to edit my .htaccess so that the RewriteBase pointed to that directory, like so:

Code:
RewriteEngine on
RewriteBase /myapplication
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
Hope this helps someone.

Last edited by cjh79 : 06-05-2008 at 02:13 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 06-12-2008, 01:56 PM
Junior Member
 
Join Date: Sep 2007
Posts: 3
Default

I am using WAMP5. My modRewrite is enabled. I have verified by placing .htaccess file in different folders.

My url for ZF application is 'http://localhost/personal/dev/ckc/'

My Is problems are:

1- If I keep 'RewriteEngine on' enabled in my .htaccess file, it gives me error. While if I comment it, then there is no error.

2- I am still unable to access 'http://localhost/personal/dev/ckc/Person' while 'http://localhost/personal/dev/ckc/' works perfectly.

Note: 'Person' is my controller class which is in the same directory as 'Index' controller.

Can anyone help me in this regards
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 05:10 PM.