Welcome Guest, Not a member yet? Register   Sign In
Problem with controllers in the URL
#1

[eluser]Volder[/eluser]
Hello, guys.

I'm facing a problem for which I can not understand the reason.

I don't have such a problem in my local environment (linux and windows), but the problem occurs when I put my site on hosting provider server.

My site is beauty-review.ru.

if you enter it - the controller by default is MAIN.
As you can see I echo there in the top:
Code:
echo $this->uri->rsegment(1).'/'.$this->uri->rsegment(2);
and I get /main/index/ by default.

the problem is when I click for the second tab - "reviews" (displayed as "Обзоры") (I have such a controller) - I still get loaded the main page (main/index), while in the URL there is /reviews displayed.

I asked the support of my hosting provider what can be the problem - the response is that on the server side everything is fine - probably the problem is in configuration of my site.

I'm using CI 1.7.1.

In my routing config I have:
Code:
$route['default_controller'] = HOME;
$route['scaffolding_trigger'] = "";

//readress all personal blogs to general ajax controller
$route['user/index/[^/]+/(ajax|img)(/.*)?'] = '/$1$2';
//readdress all blogs to index
$route['blogs/(.*/)page(:num)$'] = "blogs/index/$1page/$2";
$route['blogs(/.*)?$'] = "blogs/index$1";
//general reroutings
$route['(all)(/.*)page(:num)'] = HOME."/$1$2page/$3";
$route['(all)(/.*|$)'] = HOME."/$1$2";
$route['(page)/?(:num)'] = HOME."/$1/$2";
$route['(.*)/page(:num)'] = "$1/page/$2";
//if after the top is not topics, comments, blogs, people - then add topics
$route['top$|top/(?!topics|comments|blogs|people)(.*)'] = "top/topics/$1";

where HOME is a constant and equals 'main'.

What I have found is that when I change default controller to:
$route['default_controller'] = '';

and try to access e.g. http://beauty-review.ru/reviews/ I get an error:

Code:
An Error Was Encountered
Unable to determine what should be displayed. A default route has not been specified in the routing file.

while I'm refering not to the root of the site but to 'reviews' controller.

in my .htaccess I minified all conditions and now I have only:
Code:
RewriteCond $1 !^(index\.php|img|debug_images|images|robots\.txt|captcha|css|js|phpmyadmin|user_guide|stats|techpause\.html)
RewriteRule ^(.*)$ index.php/$1 [L]
so that /index.php/.. would be added.

Here are two screens that may help to understand what is the problem:

1. this is what happens on hosting server:

http://s017.radikal.ru/i430/1208/c0/8ad6fa7edac2.png

2. and this is the same site but locally on my machine - as you can see
everything is fine:

http://s017.radikal.ru/i434/1208/23/3632cb0a70d8.png

If anyone have faced similar problems or may assume what potentially may
cause such a behavior - please, help, because Im really frustrated because
of it.


Messages In This Thread
Problem with controllers in the URL - by El Forum - 05-23-2009, 04:41 PM
Problem with controllers in the URL - by El Forum - 05-23-2009, 06:39 PM
Problem with controllers in the URL - by El Forum - 05-24-2009, 12:10 AM
Problem with controllers in the URL - by El Forum - 05-24-2009, 12:19 AM
Problem with controllers in the URL - by El Forum - 05-24-2009, 12:26 AM
Problem with controllers in the URL - by El Forum - 05-24-2009, 12:38 AM
Problem with controllers in the URL - by El Forum - 05-24-2009, 12:48 AM
Problem with controllers in the URL - by El Forum - 05-24-2009, 01:04 AM
Problem with controllers in the URL - by El Forum - 05-24-2009, 01:13 AM
Problem with controllers in the URL - by El Forum - 05-24-2009, 01:21 AM
Problem with controllers in the URL - by El Forum - 05-24-2009, 02:12 AM
Problem with controllers in the URL - by El Forum - 05-24-2009, 09:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB