chella
chella

Reputation: 164

cakePHP URL rewrite rule for static pages

I'm using cakePHP. How do I write a rewrite rule for the following condition.

http://www.example.com/pages/about_us

to

http://www.example.com/about

and similar to contact_us and other pages.

Upvotes: 1

Views: 297

Answers (2)

Andras
Andras

Reputation: 202

app/Config/routes.php

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

Upvotes: 2

Evicted Cache
Evicted Cache

Reputation: 1401

You could use a 301 redirect like so:

Redirect 301 /about_us http://www.example.com/about

Upvotes: 0

Related Questions