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 URLs

October 27, 2011 7:41pm

Subscribe [5]
  • #1 / Oct 27, 2011 7:41pm

    mooo

    168 posts

    I have an installation of EE 2.3.0, and we’re using MSM to manage a total of 3 sites with it. After upgrading from EE 2.1 a couple weeks ago, we’re suddenly having trouble with double URLs in dynamically generated links. If I use the {homepage} variable, I get a URL like this: http://www.mysite.com/www.mysite.com. I just upgraded to the most recent version of MSM, and we’re also using NSM .htaccess with it’s standard configuration. Any thoughts?

  • #2 / Oct 28, 2011 9:54am

    mooo

    168 posts

    Also, for add-ons like Freeform, trying to use the return= parameter is impossible, because it targets a tempate group/template, so something like return=“site/thanks” will return a URL of http://www.mysite.com/www.mysite.com/site/thanks, which is, of course, not found.

  • #3 / Oct 28, 2011 11:42am

    Kevin Cupp

    791 posts

    Hi mooo,

    Can you log into your control panel, go to Admin -> General Configuration and make sure all your URLs have “http://” in front of them (sans quotes)? It sounds like the URLs may be missing that and the browser or EE thinks you’re referencing a local file called http://www.mysite.com.

    Let me know if that is or isn’t the case and we’ll go from there.

    Kevin

  • #4 / Oct 28, 2011 11:49am

    mooo

    168 posts

    All URLs have the http:// in front of them. I also noticed that if I use {homepage} by itself, but when I put it inside an <a> tag, it returns the double URL, so this: <a href=”{homepage}”> returns this: http://www.mysite.com/www.mysite.com

    I should also note that this is not happening on the “main” site. It’s an older site that I upgraded to EE2, then the other two were added recently using MSM, and their root folders are not inside the main root folder-would that make a difference?

  • #5 / Oct 28, 2011 6:27pm

    mooo

    168 posts

    Also, forgot to mention that if I just put {homepage} in the template, it just returns http://www.mysite.com without the duplication.

    Also, turning extensions off doesn’t help.

  • #6 / Oct 29, 2011 9:15am

    Mark Bowen

    12637 posts

    Hi mooo,

    I’m a little confused now as above you said that using the {homepage} variable returned http://www.mysite.com/www.mysite.com and then just in your last post it appears to only be returning it the once.

    Is it perhaps that you are placing these links into an entry maybe?

    If so then you will want to go here :

    Admin > Channel Administration > Channels > Edit Preferences (Your Channel Name) > Automatically turn URLs and email addresses into links?

    Set that to No and hopefully this should fix you up.

    Does that help at all?

    Thanks,

    Mark

  • #7 / Oct 29, 2011 9:26am

    mooo

    168 posts

    Used by itself, the {homepage} variable just returns http://www.mysite.com. I’m not using it in entries, but in templates and snippets. After a bit of further investigation, I realized that if I make an <a> tag like this: <a href=”“> in a template it will automatically parse as <a href=“http://www.mysite.com”>. That means that using this: <a href=”{homepage}”> in a template returns <a href=“http://www.mysite.com/www.mysite.com”>. I can work around that in templates by just leaving out the {homepage} variable, but in cases like using the return parameter in Freeform, it breaks because Freeform targets a template_group/template, so the URL to the return page becomes something like http://www.mysite.com/www.mysite.com/site/thanks, which of course breaks.

  • #8 / Oct 31, 2011 10:46am

    mooo

    168 posts

    Anyone have any thoughts on this? I find it really odd that I can put <a href=”“> into a template and have it parse with the homepage url.

  • #9 / Nov 01, 2011 6:33pm

    Dan Decker

    7338 posts

    Hi there mooo,

    Can you verify that you updated your MSM files as part of the update to 2.3.0? And while your at that, any chance we could talk you into moving up to 2.3.1? 😉

    Cheers,

  • #10 / Nov 01, 2011 8:10pm

    mooo

    168 posts

    I did update MSM. And just now, I updated to 2.3.1, and downloaded MSM and updated that as well, just in case. Still having the same problem.

  • #11 / Nov 02, 2011 11:37am

    mooo

    168 posts

    I also find it very perplexing that it happens on 2 out of the 3 sites running on this installation, but I can’t find any difference in any of the settings on any of them, other than pointing to the right domains.

  • #12 / Nov 02, 2011 5:38pm

    mooo

    168 posts

    Been doing a bit of testing, and <a href=”“> actually parses as http://www.mysite.com”“

    Both <a > and <a > parse as http://www.mysite.com/index.php, even though I have the “Name of the index page of your site” left blank in Admin>General Configuration.

    This is maddening.

  • #13 / Nov 02, 2011 6:30pm

    mooo

    168 posts

    A HA!

    Turns out that in the index.php file, we have this code:

    /*
     * --------------------------------------------------------------------
     *  Multiple Site Manager
     * --------------------------------------------------------------------
     *
     * Uncomment the following variables if you are using the Multiple
     * Site Manager: <a href="http://ellislab.com/expressionengine/user-guide/cp/sites">http://ellislab.com/expressionengine/user-guide/cp/sites</a>
     *
     * Set the Short Name of the site this file will display, the URL of
     * this site's admin.php file, and the main URL of the site (without
     * index.php) 
     *
     */
    // $assign_to_config['site_name']  = 'domain2_short_name';
    // $assign_to_config['cp_url'] = 'http://domain2.com/admin.php';
    // $assign_to_config['site_url'] = 'http://domain2.com';

    In order to get MSM to work you have to uncomment those last three lines and insert the relevant information. For some reason the installation I’m using is pulling the site_url out of that last line anywhere I have <a > in a template. I deleted the URL from that last line so it reads:

    // $assign_to_config['site_url'] = '';

    and the sites are working fine. I have no idea why it’s not affecting one of the sites, but it seems to be working at this point. Not sure if it’s a legitimate workaround or a hack, but I’ll see how it goes.

     

     

  • #14 / Nov 04, 2011 12:12am

    Dan Decker

    7338 posts

    Hi mooo,

    I’m glad you were able to find a solution. This may be a bug. I’ll ping the Devs on it and leave this thread open in case you need to post back with any follow-up weirdness.

    Thanks for your patience and for sharing your workaround!

    Cheers,

  • #15 / Nov 07, 2011 3:15pm

    Robin Sowell

    13255 posts

    I’d check the site_url in ‘Admin- General Config’ as it looks like it’s falling back to that.  That said- you’ll want to set the index.php for the secondary MSM sites up properly anyway.  When I don’t in testing?  The homepage url’s being populated from the database settings, which in my case is also fine once I tweak them.

    In short?  I can’t actually replicate a bug, though the behavior you saw was very odd.  I’d likely check through the general config settings for the site as a first attempt at figuring out why the double url.

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

ExpressionEngine News!

#eecms, #events, #releases