SEO-friendly URLs + "back to list page"

3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 27, 2008   (RSS)

By Deborah - December 27, 2008

I'm hoping someone here has an answer for me. I am using the SEO Urls" list viewer option: useSeoUrls' => true

The URL to the detail is encoded correctly. My issue is with the "back to list" page link shown on the detail page, in which the list viewer link results in an incorrect URL. Without the 'SEO URLs' viewer option, the link is correct.
The URL I have encoded in the HTML is:
<a href="<?php echo $newsMetaData['_listPage']; ?>">&lt;&lt; Back to list page</a>
With 'SEO URLs' enabled, the path back to the list viewer page appears to have an appended forward slash "/", which then results in an incorrect URL back to the viewer page.
This results in the following (incorrect) link:
[url "http://www.domain.com/news-detail.php/news.php"]http://www.domain.com/news-detail.php/news.php[/#0000ff][/url]
Instead of (correct) link:
[url "http://www.domain.com/news.php"]http://www.domain.com/news.php[/#0000ff][/url]

Is there something that I can modify to make this work? I know I can hard-code a link back to the main news page, but I'll be setting up archive links, so I'd prefer to have the site visitor return to the last page visited, instead of the default news page.

Thanks for any help that can be provided!

Re: [Deborah] SEO-friendly URLs + "back to list page"

By Dave - December 27, 2008

Hi Deborah,

Check the section viewer urls under: Admin > Section Editors > Viewer Urls.

They're probably relative such as "news.php". Change them to either: /news.php or http://www.domain.com/news.php and it should work fine.

What happens with SEO urls or any urls like this is the browser thinks it's in a directory called /news-detail.php/ so a link to news.php goes to /news-detail.php/news.php.

Hope that helps, let me know if you need any more help with this.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] SEO-friendly URLs + "back to list page"

By Deborah - December 27, 2008

Dave,

You were right. Adding the '/' in the Section Editor viewer URL in the admin corrected the link-back.

Thanks so much!