Jump to:

23007 Posts in 11866 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Problem with URL (www.dominio.com vs www.dominio.com/index.php)

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 495 Views
  • Josua
    Avatar
    Community Member
    86 Posts

    Problem with URL (www.dominio.com vs www.dominio.com/index.php) Link to this post

    Hello!!

    For some reason, www.dominio.com behaves differently than www.dominio.com/index.php

    In the browser if I put www.dominio.com then run saphire/main.php, and ignore _config.php, no run line Director::set_environment_type('live');
    so the output is as if 'dev', and therefore ignores combine_files methods.

    if I put www.dominio.com/index.php then run index.php, and does not ignore _config.php, it run line Director::set_environment_type('live'); and therefore does not ignore the methods combine_files.

    If I use xdebug also runs main.php instead index.php (if I put www.dominio.com).

    Whether if I put www.dominio.com as www.dominio.com/index.php should run index.php.

    What can be happening?

    Please, help.

    This is my first post and my English is very bad. Sorry.
    Thanks in advance for your answers.

    Jose A.

    The following code shows you my .htaccess and _config.php files:

    -----------------------------------------------------------------------------------
    My mysite/_config.php:
    -----------------------------------------------------------------------------------

    <?php
    global $project;
    $project = 'mysite';

    global $databaseConfig;
    $databaseConfig = array(
       "type" => 'MySQLDatabase',
       "server" => 'localhost',
       "username" => 'xxxxxxxxx',
       "password" => 'xxxxxxxx',
       "database" => 'ss_database',
       "path" => '',
    );

    MySQLDatabase::set_connection_charset('utf8');

    // This line set's the current theme. More themes can be
    // downloaded from http://www.silverstripe.org/themes/
    SSViewer::set_theme('blackcandy');

    // Set the site locale
    i18n::set_locale('en_US');

    // enable nested URLs for this site (e.g. page/sub-page/)
    SiteTree::enable_nested_urls();

    /**
    * Set environment: 'dev', 'test', or 'live'.
    */
    Director::set_environment_type('live');

    -----------------------------------------------------------------------------------
    My .htaccess:
    -----------------------------------------------------------------------------------

    ### SILVERSTRIPE START ###
    <Files *.ss>
       Order deny,allow
       Deny from all
       Allow from 127.0.0.1
    </Files>

    <Files web.config>
       Order deny,allow
       Deny from all
    </Files>

    ErrorDocument 404 /assets/error-404.html
    ErrorDocument 500 /assets/error-500.html

    <IfModule mod_alias.c>
       RedirectMatch 403 /silverstripe-cache(/|$)
    </IfModule>

    <IfModule mod_rewrite.c>
       SetEnv HTTP_MOD_REWRITE On
       RewriteEngine On
       RewriteBase /

       RewriteCond %{REQUEST_URI} ^(.*)$
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
    </IfModule>
    ### SILVERSTRIPE END ###

  • IOTI
    Avatar
    Community Member
    187 Posts

    Re: Problem with URL (www.dominio.com vs www.dominio.com/index.php) Link to this post

    I don't have an answer for you but you might want to remove your databaseConfig details from your post for _config - If that is for your live site - May not be the best idea to show that to the world

  • Josua
    Avatar
    Community Member
    86 Posts

    Re: Problem with URL (www.dominio.com vs www.dominio.com/index.php) Link to this post

    Oopssss .... thank you very much.

    Regards,

    Jose A

  • Josua
    Avatar
    Community Member
    86 Posts

    Re: Problem with URL (www.dominio.com vs www.dominio.com/index.php) Link to this post

    I've been able to solve my problem.
    It was a matter of SESSION cookies ($_SESSION['isDev'].

    Thanks.

    Jose A.

    495 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.