Harsha M V
Harsha M V

Reputation: 54979

CakePHP URLs having .html extension

We are converting an exisiting HTML site into a CMS using CakePHP. Since SEO of the site has been mapped with keywords and indexed by Google the static pages i want to have urls to have the extention .html

I had a look at the Document here

But am not quite sure how to achieve this in the right way.

Any one who has worked on it can give some pointers?

Upvotes: 0

Views: 307

Answers (1)

Florian Drechsler
Florian Drechsler

Reputation: 178

simply put this line into your Router Router::parseExtensions('html');

This will tell the Router to cut off the .html as an Extension and parse what remains. To Create correct Links to the Pages you have to give the Link() function another Parameter called "ext".

Like this:

$this->Html->link(
   'Super Seo link',
   array(
       'controller' => 'anyController',
       'action' => 'someAction',
       'title' => 'seo-title-for-gods-sake',
       'ext' => 'html'
   )  );

Have fun! Florian

Upvotes: 2

Related Questions