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.

Genereated URLs in secondary MSM site are not correct

December 22, 2010 7:08pm

Subscribe [4]
  • #1 / Dec 22, 2010 7:08pm

    Nicolas E

    44 posts

    Hello

    We have two websites on the same EE MSM system that have a “servicios” menu showing entries in another template; we have duplicated them manually (the templates) but the code that generates the link for the services menu does not work in the secondary website but It works fine in the first one. This is the code:

    <li>
                                        <a href="http://{site_url}index.php/servicios/class=active">Servicios</a>
                                        <ul>
                                            {exp:channel:entries channel="grupos" dynamic="no" limit="20" sort="asc"}
                                            <li>
                                                <a href="http://{site_url}index.php/servicios/">{title}</a>
                                                <ul>
                                                    {reverse_related_entries orderby="title"}
                                                    <li><a href="http://{title_permalink=">{title}</a></li>
                                                    {/reverse_related_entries}
                                                </ul>
                                            </li>
                                            {/exp:channel:entries}
                                        </ul>
                                    </li>

    The main website is http://www.banaduana.com/index.php, and the secondary website is http://www.turbaduana.com/index.php, take a look into “title_permalink” result into the secondary website, for example trying to reach a secondary service (http://www.turbaduana.com/http://www.turbaduana.com/servicios/detalle/servicio_01_turbaduana_agencia_aduanero) but with the same code in main website the result is correct (http://www.banaduana.com/index.php/servicios/detalle/administracion_de_programa_plan_vallejo).

    Thanks in advance,


    Nicolas E.

  • #2 / Dec 27, 2010 9:32am

    Sue Crocker

    26054 posts

    Hi, Nicholas E. Are you attempting to remove index.php via .htaccess on this secondary site?

    For your reverse related entries, is it coming from siteA or siteB?

  • #3 / Dec 27, 2010 3:28pm

    Nicolas E

    44 posts

    Sue,

    No, we’re not trying to remove index.php we only need for links on the secondary site with “title_permalink” and “site_url” to generate the correct URLs.
    As you see, now instead of generating something like:
    http://www.turbaduana.com/index.php/servicios/detalle/servicio_01_turbaduana_agencia_aduanero
    It generates this wrong URL:
    http://www.turbaduana.com/http://www.turbaduana.com/servicios/detalle/servicio_01_turbaduana_agencia_aduanero
    You see? no index.php and double www….

    Let me know your thoughts,

    Best,

    Nicolas E.

  • #4 / Dec 27, 2010 7:47pm

    Brandon Jones

    5500 posts

    Hi Nicolas,

    Can you confirm the version and build of EE and the MSM you’re using? Can you show us what MSM settings you have in the second site’s index.php file?

  • #5 / Jan 03, 2011 8:52pm

    Nicolas E

    44 posts

    Brandon,

    The versions are:
    EE v2.1.3
    MSM Version: 2.0 Build: 20101215

    The code on the index.php for turbaduana.com (the secondary site) is:

    <?php
    /**
     * ExpressionEngine - by EllisLab
     *
     * @package        ExpressionEngine
     * @author        ExpressionEngine Dev Team
     * @copyright    Copyright (c) 2003 - 2010, EllisLab, Inc.
     * @license        <a href="http://ellislab.com/expressionengine/user-guide/license.html">http://ellislab.com/expressionengine/user-guide/license.html</a>
     * @link        <a href="http://expressionengine.com">http://expressionengine.com</a>
     * @since        Version 2.0
     */
    
    /*
     * --------------------------------------------------------------------
     *  SYSTEM PATH
     * --------------------------------------------------------------------
     *
     * The following variable contains the server path to your
     * ExpressionEngine "system" folder.  By default the folder is named
     * "system" but it can be renamed for increased security.  If you
     * have changed the name of the system folder please indicate the
     * new name here, and include the server path.  The path can be a
     * simple relative path or it can be a full server path.
     * 
     */
        $system_path = '/home/turbaduana/www/banaduana.com/system';
    
    /*
     * --------------------------------------------------------------------
     *  ERROR REPORTING OVERRIDE
     * --------------------------------------------------------------------
     *
     * PHP and database errors are normally displayed dynamically based
     * on the authorization level of each user accessing your site.  
     * This variable allows the error reporting system to be overridden, 
     * which can be useful for low level debugging during site development, 
     * since errors happening before a user is authenticated will not normally 
     * be shown.  Options:
     *
     *    $debug = 0;  Default setting. Errors shown based on authorization level
     *
     *    $debug = 1;  All errors shown regardless of authorization
     *
     * NOTE: Enabling this override can have security implications.
     * Enable it only if you have a good reason to.
     * 
     */
        $debug = 1;
    
    /*
     * --------------------------------------------------------------------
     *  CUSTOM CONFIG VALUES
     * --------------------------------------------------------------------
     *
     * The $assign_to_config array below will be passed dynamically to the
     * config class. This allows you to set custom config items or override
     * any default config values found in the config.php file.  This can
     * be handy as it permits you to share one application between more then
     * one front controller file, with each file containing different 
     * config values.
     *
     * Un-comment the $assign_to_config array below to use this feature
     *
     * NOTE: This feature can be used to run multiple EE "sites" using
     * the old style method.  Instead of individual variables you'll
     * set array indexes corresponding to them.
     *
     */
    //    $assign_to_config['template_group'] = '';
    //    $assign_to_config['template'] = '';
        $assign_to_config['site_index'] = 'http://www.turbaduana.com/';
    //    $assign_to_config['site_404'] = '';
    //    $assign_to_config['global_vars'] = array(); // This array must be associative
    
    /**
     * If you are running the Multiple Site Manager, uncomment and assign the following variables 
     * See <a href="http://ellislab.com/expressionengine/user-guide/cp/sites/domainsetup.html">http://ellislab.com/expressionengine/user-guide/cp/sites/domainsetup.html</a>
     */
     $assign_to_config['site_name'] = 'turbaduana';
    // $assign_to_config['cp_url'] = '';
     $assign_to_config['site_url'] = 'http://www.turbaduana.com';
    
    /*

    Thanks a lot for your help,

    Nicolas E.

  • #6 / Jan 04, 2011 4:00pm

    Ingmar

    29245 posts

    Have you condfigured the site_url for turbaduana.com correctly as well?

  • #7 / Jan 04, 2011 9:05pm

    Nicolas E

    44 posts

    Ingmar,

    Yes, please see the attached PNG.
    Waiting for your response,

    Best,

    Nicolas E.

  • #8 / Jan 05, 2011 1:54pm

    Brandon Jones

    5500 posts

    Hi Nicolas,

    In your index.php for turbaduana.com (the secondary site), try changing

    $assign_to_config['site_index'] = 'http://www.turbaduana.com/';

    to

    $assign_to_config['site_index'] = 'index.php';

    Does that help?

  • #9 / Jan 05, 2011 2:20pm

    Nicolas E

    44 posts

    Brandon,

    Beautiful!
    Thanks a lot, it now works perfect.

    Thanks again,

    Nicolas E.

  • #10 / Jan 05, 2011 3:35pm

    Ingmar

    29245 posts

    Very glad to hear it. Post again as needed, please.

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

ExpressionEngine News!

#eecms, #events, #releases