0
votes

I was using cakephp 1.2 and recently i updated cake version and migrated to 2.4.

Before we were using many .htaccess rules for applications . We write them in /webroot/.htaccess file . But after the migration to 2.4 , any rules are not working .

E.G

RewriteCond %{REQUEST_FILENAME} -d

RewriteCond %{REQUEST_URI} /news/$

RewriteRule ^(.*)$ pages/news/ [QSA,L]

But this rules not working on cake 2.4. Can Anybody help me to solve this issues?

1

1 Answers

0
votes

Your best option is probably to not use the mod_rewrite rules but to use the Router class instead.

If you edit the file app/config/routes.php and add a route like this (Assuming you want to call PagesController::display('news')):

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

You should get the same result.