Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

Problem with URL (www.dominio.com vs www.dominio.com/index.php)


Reply


4 Posts   631 Views

Avatar
Josua

Community Member, 86 Posts

6 January 2012 at 7:58am

Edited: 06/01/2012 10:18am

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 ###

Avatar
copernican

Community Member, 189 Posts

6 January 2012 at 10:02am

Edited: 06/01/2012 10:02am

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 :)

Avatar
Josua

Community Member, 86 Posts

6 January 2012 at 10:22am

Edited: 06/01/2012 10:22am

Oopssss .... thank you very much. :)

Regards,

Jose A

Avatar
Josua

Community Member, 86 Posts

7 January 2012 at 12:38am

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

Thanks.

Jose A.