Solona Armstrong
Solona Armstrong

Reputation: 535

Redirect a page using htaccess in cakePHP

I am trying to redirect one page in cakephp. My guess is that .htaccess is the way to do this.

I'm trying to redirect from /consultation to /pages/consultation2016

I have this:

    Redirect /consultation http://thep.ca/pages/consultation2016
 <IfModule mod_rewrite.c>
    RewriteEngine on
   php_value post_max_size 70M
   php_value upload_max_fiesize 70M
    RewriteBase /app
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
 </IfModule>

Upvotes: 0

Views: 255

Answers (1)

Salines
Salines

Reputation: 5767

Redirect without touching .htaccess:

CakePHP 2 (documentation):

Router::redirect('/consultation','http://thep.ca/pages/consultation2016');

CakePHP 3 (documentation):

$routes->redirect('/consultation','http://thep.ca/pages/consultation2016');

Upvotes: 1

Related Questions