In routes.php add the following code
Now under site controller in display action add this
Router::connect('/*', array('controller' => 'Site', 'action' => 'display'));
What this does is each time you fire a url with "/parameter" it redirects to Site controller and display actionNow under site controller in display action add this
class SiteController extends AppController
{
public $name="Site";
public function display()
{
$path = func_get_args();
//print_r($path);
$count = count($path);
if (!$count)
{
$this->redirect('/');
}
else
{
$this->render(implode('/', $path));
}
}
}
Good article
ReplyDeletehttps://wordpress-special-plugin.blogspot.co.id