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.

Too many URL segments

May 24, 2010 5:11pm

Subscribe [3]
  • #1 / May 24, 2010 5:11pm

    pychap

    69 posts

    Hi,

    I am working through Ryan Ireland’s EE tutorials creating the Engine City News Site, although this question should not be tied to the tutorials. The site is here, below my main site: Newspaper Tutorial Site

    The problem is, setting up the main navigation, when I click on the links multiple times the url just lengthens and lengthens, until I get this “Error: The URL contains too many segments.”

    In my embed Masthead template I have this code:

    <ul>
                <li><a href="http://{site_url}class=current">Home</a></li>
                <li><a href="http://index.php/news_articles/page/category/newsclass=current">News</a></li>
                <li><a href="http://index.php/news_articles/page/category/sportsclass=current">Sports</a></li>
                <li><a href="http://index.php/news_articles/page/category/politicsclass=current">Politics</a></li>
                        <li><a href="http://">Obits</a></li>
                    </ul>

    Now also, I went through days of trying to get index.php out of my URL to no avail (god I wish that was easier), and so I added it to the paths as you can see. I deleted the .httpaccess file off of my server, disabled the LG .htaccess Generator extension thinking they might be behind the trouble.

    Should I be going about my paths differently above or something else?

    Thanks for any help,
    Pete

  • #2 / May 24, 2010 7:31pm

    Brandon Jones

    5500 posts

    Hi pychap,

    Hard-coding index.php in your templates is not recommended. Use {site_url} and {path=''} where appropriate.

    For your category links, take a look at this discussion. Does that help?

  • #3 / May 25, 2010 11:41am

    pychap

    69 posts

    Yes, the {path=''} fixed it!

    <ul>
                <li><a href="http://{site_url}class=current">Home</a></li>
                <li><a href="http://{path=news_articles/page/category/news}class=current">News</a></li>
                <li><a href="http://{path=news_articles/page/category/sports}class=current">Sports</a></li>
                <li><a href="http://{path=news_articles/page/category/politics}class=current">Politics</a></li>
                <li><a href="http://">Obits</a></li>
        </ul>


    Thank you!
    Pete

  • #4 / May 25, 2010 11:49am

    Sue Crocker

    26054 posts

    Glad Brandon was able to help. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases