 Laravel по-русски
Laravel по-русски
      
      
    Русское сообщество разработки на PHP-фреймворке Laravel.
Ты не вошёл. Вход тут.
Страницы 1
Здравствуйте. 
Решил переехать на другой хостинг.
Имел работающий (на сколько мне нужно) сайт на laravel.
В результате у меня открывается только главная страница index.php.
А все остальные страницы не открываются. Как будто неправильно работают контролеры или что-то ещё.
Хотя всё скопировано точно и, раз главная открывается, то значит сам laravel работает.
Но все страницы почему то "не найдены".
В чём может быть проблема?
Не в сети
В общем после перенос на другой хостинг ссылочная структура перестала работать.
Полностью рабочая главная страница, но не открывается ни одна из других.
В чем может быть проблема? Попробовал уже на 5 разных хостингах, везде одинаково работает только главка.
Не в сети
Никто не знает?
Кроме базданных и строчи в файле application.php - "'url' => 'http://baget.hostenko()com',"
ничего больше не надо уточнять для нового хостинга?
Не в сети
 Мастер
Мастер						
А можно посмотреть ваши конфиги сервера и файл routes.php?
Не в сети
routes.php
<?php
Route::get('/(:num)', array('as' => 'item', 'uses' => 'item@index'));
Route::get('lang/(:any)', array('as' => 'lang', 'uses' => 'lang@index'));
Route::get('admin/lang/(:any)', array('as' => 'admin_lang', 'uses' => 'lang@index'));
Route::get('admin/db/(:any)', array('uses' => 'admin.db@index'));
Route::get('admin/blog_area/(:num)', array('uses' => 'admin.blog_area@index'));
Route::get('admin/post_area/(:num)', array('uses' => 'admin.post_area@index'));
Route::get('admin/section_area/(:num)', array('uses' => 'admin.section_area@index'));
Route::controller(Controller::detect());
Route::group(array('before' => 'auth'), function()
{
	// Do stuff before auth
    Route::get('admin/(:any?)', function()
    {
        //
    });
});
Event::listen('404', function()
{
	return Response::error('404');
});
Event::listen('500', function()
{
	return Response::error('500');
});
Route::filter('before', function()
{
	// Do stuff before every request to your application...
	if(!Session::get('lang', null) && !Cookie::get('lang'))
	{
		Session::put('lang', Config::get('application.language'));
	}
	
	if(Cookie::get('lang'))
	{
		Session::put('lang', Cookie::get('lang'));
	}
	if(Cookie::get('userdata_id')){
		Utilites::revokeUser();
	}
	if(Cookie::get('admin_id')){
		Utilites::revokeAdmin();
	}
	
	if(!Session::get('user.access_level'))
	{
	    Session::put('user.access_level', '1');
	}
	
	if(!Session::get('href.previous'))
	{
	    Session::put('href.previous', URL::home());
	}
});
Route::filter('after', function($response)
{
	// Do stuff after every request to your application...
});
Route::filter('csrf', function()
{
	if (Request::forged()) return Response::error('500');
});
Route::filter('auth', function()
{
	if (!Admin::check()){
		return Redirect::to('admin/login');
	}
});Не в сети
application.php
<?php
return array(
	/*
	|--------------------------------------------------------------------------
	| Application URL
	|--------------------------------------------------------------------------
	|
	| The URL used to access your application without a trailing slash. The URL
	| does not have to be set. If it isn't we'll try our best to guess the URL
	| of your application.
	|
	*/
	'url' => 'http://baget.hostenko()com',
	'name' => 'Багетная мастерская Рама–студио',
	'site_email' => 'info@yourdomain com',
	'no-reply_email' => 'no-reply@yourdomain com',
	'google_analytics' => '',
	'meta_tags' => 'tag1, tag2,',
	'meta_creator' => 'Veliov Group: Dmitriy A.',
	'default_loader' => '',
	'footer_sign' => '',
	/*
	|--------------------------------------------------------------------------
	| Asset URL
	|--------------------------------------------------------------------------
	|
	| The base URL used for your application's asset files. This is useful if
	| you are serving your assets through a different server or a CDN. If it
	| is not set, we'll default to the application URL above.
	|
	*/
	'asset_url' => '',
	/*
	|--------------------------------------------------------------------------
	| Application Index
	|--------------------------------------------------------------------------
	|
	| If you are including the "index.php" in your URLs, you can ignore this.
	| However, if you are using mod_rewrite to get cleaner URLs, just set
	| this option to an empty string and we'll take care of the rest.
	|
	*/
	'index' => '',
	/*
	|--------------------------------------------------------------------------
	| Application Key
	|--------------------------------------------------------------------------
	|
	| This key is used by the encryption and cookie classes to generate secure
	| encrypted strings and hashes. It is extremely important that this key
	| remain secret and should not be shared with anyone. Make it about 32
	| characters of random gibberish.
	|
	*/
	'key' => 'd3dsfsdfdcs96230newf', //change to yourdomain com unique key
	/*
	|--------------------------------------------------------------------------
	| Profiler Toolbar
	|--------------------------------------------------------------------------
	|
	| Laravel includes a beautiful profiler toolbar that gives you a heads
	| up display of the queries and logs performed by your application.
	| This is wonderful for development, but, of course, you should
	| disable the toolbar for production applications..
	|
	*/
	'profiler' => false, // turn off or on
	/*
	|--------------------------------------------------------------------------
	| Application Character Encoding
	|--------------------------------------------------------------------------
	|
	| The default character encoding used by your application. This encoding
	| will be used by the Str, Text, Form, and any other classes that need
	| to know what type of encoding to use for your awesome application.
	|
	*/
	'encoding' => 'UTF-8',
	/*
	|--------------------------------------------------------------------------
	| Application Language
	|--------------------------------------------------------------------------
	|
	| The default language of your application. This language will be used by
	| Lang library as the default language when doing string localization.
	|
	*/
	'language' => 'en',
	/*
	|--------------------------------------------------------------------------
	| SSL Link Generation
	|--------------------------------------------------------------------------
	|
	| Many sites use SSL to protect their users data. However, you may not be
	| able to use SSL on your development machine, meaning all HTTPS will be
	| broken during development.
	|
	| For this reason, you may wish to disable the generation of HTTPS links
	| throughout your application. This option does just that. All attempts
	| to generate HTTPS links will generate regular HTTP links instead.
	|
	*/
	'ssl' => true,
	/*
	|--------------------------------------------------------------------------
	| Application Timezone
	|--------------------------------------------------------------------------
	|
	| The default timezone of your application. The timezone will be used when
	| Laravel needs a date, such as when writing to a log file or travelling
	| to a distant star at warp speed.
	|
	*/
	'timezone' => 'UTC',
	/*
	|--------------------------------------------------------------------------
	| Class Aliases
	|--------------------------------------------------------------------------
	|
	| Here, you can specify any class aliases that you would like registered
	| when Laravel loads. Aliases are lazy-loaded, so feel free to add!
	|
	| Aliases make it more convenient to use namespaced classes. Instead of
	| referring to the class using its full namespace, you may simply use
	| the alias defined here.
	|
	*/
	'aliases' => array(
		'Auth'       	=> 'Laravel\\Auth',
		'Authenticator' => 'Laravel\\Auth\\Drivers\\Driver',
		'Asset'      	=> 'Laravel\\Asset',
		'Autoloader' 	=> 'Laravel\\Autoloader',
		'Blade'      	=> 'Laravel\\Blade',
		'Bundle'     	=> 'Laravel\\Bundle',
		'Cache'      	=> 'Laravel\\Cache',
		'Config'     	=> 'Laravel\\Config',
		'Controller' 	=> 'Laravel\\Routing\\Controller',
		'Cookie'     	=> 'Laravel\\Cookie',
		'Crypter'    	=> 'Laravel\\Crypter',
		'DB'         	=> 'Laravel\\Database',
		'Eloquent'   	=> 'Laravel\\Database\\Eloquent\\Model',
		'Event'      	=> 'Laravel\\Event',
		'File'       	=> 'Laravel\\File',
		'Filter'     	=> 'Laravel\\Routing\\Filter',
		'Form'       	=> 'Laravel\\Form',
		'Hash'       	=> 'Laravel\\Hash',
		'HTML'       	=> 'Laravel\\HTML',
		'Input'      	=> 'Laravel\\Input',
		'IoC'        	=> 'Laravel\\IoC',
		'Lang'       	=> 'Laravel\\Lang',
		'Log'        	=> 'Laravel\\Log',
		'Memcached'  	=> 'Laravel\\Memcached',
		'Paginator'  	=> 'Laravel\\Paginator',
		'Profiler'  	=> 'Laravel\\Profiling\\Profiler',
		'URL'        	=> 'Laravel\\URL',
		'Redirect'   	=> 'Laravel\\Redirect',
		'Redis'      	=> 'Laravel\\Redis',
		'Request'    	=> 'Laravel\\Request',
		'Response'   	=> 'Laravel\\Response',
		'Route'      	=> 'Laravel\\Routing\\Route',
		'Router'     	=> 'Laravel\\Routing\\Router',
		'Schema'     	=> 'Laravel\\Database\\Schema',
		'Section'    	=> 'Laravel\\Section',
		'Session'    	=> 'Laravel\\Session',
		'Str'        	=> 'Laravel\\Str',
		'Task'       	=> 'Laravel\\CLI\\Tasks\\Task',
		'URI'        	=> 'Laravel\\URI',
		'Validator'  	=> 'Laravel\\Validator',
		'View'       	=> 'Laravel\\View',
	),
);Изменено d1st (15.05.2013 22:08:03)
Не в сети
Кстати говоря и 404 ошибка тоже не ларавелевская.
Ну т.е. всё игнорируется, кроме главной index.php
Не в сети
 Мастер
Мастер						
В application.php установите 'url' => '', затем в application/start.php установите значение ini_set('display_errors', 'On'), посмотрите какие ошибки пишет.
Не в сети
В start.php всё так и стояло. В application.php установил 'url' => ''
Ничего он не показывает. Всё так же работает только главная страница.
Не в сети
 Мастер
Мастер						
Попробуйте поставить "чистый" laravel. Если не заработает общайтесь с хостерами, возможно у них есть специфические настройки. Проверьте .htaccess. На продакшене должно стоять ini_set('display_errors', 'Off').
Не в сети
 Мастер
Мастер						
Тут можно даже без Laravel проверить — оставь .htaccess, удали всё остальное и создай пустой index.php. Если у тебя правильно настроен .htaccess (то есть он перенаправляет все запросы на index.php), то 404 не будет ни на одной странице (будет пустой ответ, если в index.php ничего нет). Если же пустой ответ будет только на http://site.ru/ и http://site.ru/index.php, а на любых других 404 — значит, у хостера отключен .htaccess или mod_rewrite или он использует nginx или какой-то другой сервер.
Не в сети
Может в аппаче mod_rewrite надо включить?
Страницы 1