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.

Double slash issues with site_url and page_uri

August 08, 2012 2:30pm

Subscribe [2]
  • #1 / Aug 08, 2012 2:30pm

    Coalescent

    48 posts

    Hi -

    I’m using {site_url}{page_uri} in a variety of places and having an issue with a double slash issue on the resulting strings (ie. http://www.domain.com//page).

    It seems the site_url variable always appends a trailing slash (even if you omit it in the general config settings) and the page_uri field seems to always save a leading slash in the entry forms (even if you don’t type one in).

    If there a way to remove one of these slashes from either variable? I’m running 2.5.2 and latest MSM.

    Thanks,
    Mike

  • #2 / Aug 09, 2012 11:30am

    Shane Eckert

    7174 posts

    Hello Mike,

    Thank you for posting your question here on the ExpressionEngine forums.

    Can you check your config.php file for a hard coded url? The config file will override anything set in the Control Panel.

    Thank you,

  • #3 / Aug 09, 2012 2:33pm

    Coalescent

    48 posts

    I assume you’re referring to the ‘base_url’ setting? That’s blank in the config doc.

    So EE should be respecting the non-trailing slash site_url setting we entered in the CP?

  • #4 / Aug 09, 2012 3:26pm

    Shane Eckert

    7174 posts

    Hello Mike,

    Yes it should.

    A good test is to create a new template and put {site_url} and {page_uri} and see what they both produce.

    {page_uri} should reflect what you have under entries and in the page tab. Like “/pagetitle/”.

    Can you try that and tell me what that does?

    It’s also possible that each channel has the URL hard coded with a trailing slash. The setting is under Channel Settings and “Channel URL”. That is worth checking.

    Cheers

  • #5 / Aug 09, 2012 4:13pm

    Coalescent

    48 posts

    Sorry - figured it out. While we didn’t have anything set in the config.php, we did have that setting in the index.php for that site. Slash removed there and it’s all good. Thanks for the help.

  • #6 / Aug 09, 2012 4:15pm

    Shane Eckert

    7174 posts

    Hey Mike,

    Awesome, really glad you are back in business!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases