A
A
Alexander2015-12-08 12:48:43
Kohana
Alexander, 2015-12-08 12:48:43

Kohana 3.1.4 routing problem loading only start page?

There was a problem with the routing of the project on the hosting.
Hosting - Apache/2.4.10 (Debian) Server
project folder - html/bdpn/ajax-new/old-php-layer/
Project on Kohana 3.1.4 , when starting the project, only the default route works, when accessing other paths, they are not displayed, the message The requested URL /html/bdpn/ajax-new/old-php-layer/test was not found on this server
appears .htaccess file

# Turn on URL rewriting
RewriteEngine On

# Installation directory
#RewriteBase /

# Protect hidden files from being viewed
<Files .*>
  Order Deny,Allow
  Deny From All
</Files>

# Protect application and system files from being viewed
#RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ /html/bdpn/ajax-new/old-php-layer/index.php?/$1 [L]

bootstrap.php file
Kohana::init(array(
  'index_file' => false,	
  //'base_url'   => 'http://localhost:8888/cniis/php-layer/'
  //'base_url' => 'http://192.168.1.220/html/bdpn/ajax-new/old-php-layer'
  'base_url' =>'/'
  //'base_url' => 'http://inviziblll.ru/php-layer/old-php-layer/',
)); 
....
Route::set('test', 'test')
  ->defaults(array(
            //'directory'  => 'index',
            'controller' => 'welcome',
            'action'     => 'test',
));

Route::set('logout', 'logout')
  ->defaults(array(
            //'directory'  => 'index',
            'controller' => 'welcome',
            'action'     => 'logout',
));


Route::set('default', '(<controller>(/<action>(/<id>)))')
  ->defaults(array(
    'controller' => 'welcome',
    'action'     => 'index',
));

What could be the problem? The same project was placed on another hosting where the paths work (adjusted for the fact that I changed the base_url and registered a different path in the RewriteRule), I have a suspicion that additional settings are needed in the .htaccess file or in the php server settings.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2015-12-17
@AmberLEX

I met hostings where there were such settings for it to work, try it, in theory you can find a problem on the hosting forum or in technical support.
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
# hostinger.com.ua
#RewriteRule ^(.*)$ index.php?/$1 [PT]
# ukraine.com. ua
#RewriteRule .* index.php?kohana_uri=$0 [PT,L,QSA]
Or set VirtualHost if you have access

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question