Question

I'm just starting to use C5 as a CMS, and I'm having issues with sorting out the page addresses.

If I add a page to the site, it will be visible at:

www.example.com/index.php/page

However, I find the url extremely messy, and would ideally like it to be

www.example.com/page

I'm not familiar with C5, would anyone be able to give me any pointers to change this?

Was it helpful?

Solution

Okay, After reading documentation, this can be done by enabling "Pretty URLs"

This can be achieved by:

Dashboard -> System and Settings -> SEO and Statistics -> Pretty URLs

You then get a dialogue which has a tickbox, select it and click SAVE.

C5 should be able to rewrite the .htaccess file. If it is unable to do so, it will give you an error, and you can copy and paste the text generated in the next screen, to add to the file manually.

Dashboard View System ans Settings Pretty URL Dialogue Pretty URLs are now enabled

OTHER TIPS

I see that you enabled pretty URLs on the dashboard:

http://www.yoursite.com/index.php/dashboard/system/seo/urls/

Nice work, one last step—add the following to site.php in your root/config/:

define('URL_REWRITING_ALL', true);

That'll make every URL, such as a link to a dashboard page, pretty:

http://www.yoursite.com/dashboard/system/seo/urls/

Whilst this will add friendly URL's it will not add create canonical urls, if the same page appears with various urls they will create duplicated content links.

To add a canonical link you can add the following to your header.

//Set the base url for the home page
$canonical = BASE_URL.DIR_REL;
if ($c->getCollectionId() != 1){
    //Get the current URL for the page
    $canonical=$nh->getCollectionURL($c);
}
//Output a canonical meta tag  
printf('<link rel="canonical" href="%s" />', $canonical);echo "\n"; 

you can go to dashboard > Bulk SEO Updater > and change the URL here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top