1

This is literally my first day using PHP. I've never seen it until today, so please go easy on me. I can't understand why one of the urls doesn't work.

/* http://localhost works so I know this path is all set up */

Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));

/* http://localhost/pages/ or http://localhost/pages/about is 
"Requested URL pages not found" even though it points 
to the same known working path */

Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display', 'home'));

I have Configure::write('debug', 2); in core.php.

In this same Ubuntu box I was playing with pure PHP and strangely whenever I used that the _POST array was empty, no matter what the form tried to do. Do I have some setting that says no input except '/' is allowed?

johnsyweb
  • 136,902
  • 23
  • 188
  • 247
Joe C
  • 2,728
  • 4
  • 30
  • 38

1 Answers1

1

The other links are dependent on mod_rewrite.

Please ensure that mod_rewrite is enabled via:

sudo a2enmod rewrite

You will need to restart your server via:

sudo /etc/init.d/apache2 restart

Lastly, you will need to make sure your vhost does not have AllowOverride set to none.

For testing, you can set it to All. You will need to restart your server again if you need to change this.

conrad10781
  • 2,223
  • 19
  • 17
  • You're a life saver. Thank you. I'd already had mod_rewrite and in file /etc/apache2/sites-available/default I had this DocumentRoot /var/www/cakephp/app/webroot Options FollowSymLinks AllowOverride All Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all I had to change that second one to 'All' as well. – Joe C Feb 26 '12 at 04:05