ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Removing "/view" from article URLs

February 09, 2011 8:01am

Subscribe [3]
  • #1 / Feb 09, 2011 8:01am

    James Abbott

    22 posts

    Hi, I want my URLs to be home/articles/name-of-blog-entry instead of this:

    http://jamesabbottdd.com/articles/view/test_entry_4

    I want the “view” part of the URL to be gone. My template looks like this:

    {exp:channel:entries channel="articles" limit="5" status="open | Featured Top Story | Top Story"}
       <li><a href="http://{title_permalink=">{title}</a></li>
    {/exp:channel:entries}

    When I try to use

    title_permalink="articles"
    instead of
    title_permalink="articles/view"

    the article that is being linked to doesn’t appear.

    How do I fix this?

    Thanks, James

  • #2 / Feb 09, 2011 2:44pm

    carvingCode

    380 posts

    Is ‘view’ the name of a template inside the ‘articles’ template group?  If so, you could rename it to ‘index’.  Then you can just use ‘title_permalink=“articles”’.

    Otherwise, you’ll need to adjust your .htaccess rewite code.

  • #3 / Feb 10, 2011 4:48am

    John Henry Donovan

    12339 posts

    James,

    Does carvingCode’s advice help?

    Also try the following. You will need to adjust slightly for EE2 with correct tags

    EE Wiki : Cruft Free URLs

  • #4 / Feb 10, 2011 8:51am

    James Abbott

    22 posts

    Hi,-

    thanks for the replies but I’m not quite through with this yet.

    Is ‘view’ the name of a template inside the ‘articles’ template group?  If so, you could rename it to ‘index’.  Then you can just use ‘title_permalink=“articles”’.

    Yes, it is the name of the template through which individual blog entries are rendered. I already have an “index” template there, and that template renders the articles index page:

    http://jamesabbottdd.com/articles

    For that reason, it doesn’t seem to me that I can change “view” to “index” - these are 2 different templates each with a separate role.

    I have a similar issue with the category URLs. Another template I have in the same template group is “page”. This gives me URLs like:

    http://jamesabbottdd.com/articles/page/category/css3

    Whereas I’d like it to be:

    http://jamesabbottdd.com/articles/categories/css3


    Thanks,
    James

  • #5 / Feb 10, 2011 3:13pm

    Ingmar

    29245 posts

    For that reason, it doesn’t seem to me that I can change “view” to “index” - these are 2 different templates each with a separate role.

    If there is a valid url_title in segment_3 EE will only show that particular entry. This works: http://jamesabbottdd.com/articles/test_entry_4

    That said, this is a complex and potentially confusing area. My suggestion would be to read up on it a bit: there’s more than you ever wanted to know about EE’s url structure here.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases