Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Kohana] The requested URL / was not found on this server.
pifarek
post 11.11.2012, 16:05:02
Post #1





Grupa: Zarejestrowani
Postów: 91
Pomógł: 15
Dołączył: 3.03.2009
Skąd: Włocławek

Ostrzeżenie: (0%)
-----


Witam.
Mam serwer na linuxpl.com, wgrałem tam aplikację na Kohana 3.3, ustawiłem .htaccess i bootstrap.php, do serwera jest podpięta domenta. Po wpisaniu adresu w przeglądarkę pokazuje się błąd Kohany: "The requested URL / was not found on this server.".
bootstrap.php:
  1. Kohana::init(array(
  2. 'base_url' => '/',
  3. 'index_file' => false
  4. ));

.htaccess:
  1. # Turn on URL rewriting
  2. RewriteEngine On
  3.  
  4. # Installation directory
  5. RewriteBase /
  6.  
  7. # Protect hidden files from being viewed
  8. <Files .*>
  9. Order Deny,Allow
  10. Deny From All
  11. </Files>
  12.  
  13. # Protect application and system files from being viewed
  14. RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
  15.  
  16. # Allow any files or directories that exist to be displayed directly
  17. RewriteCond %{REQUEST_FILENAME} !-f
  18. RewriteCond %{REQUEST_FILENAME} !-d
  19.  
  20. # Rewrite all other URLs to index.php/URL
  21. RewriteRule .* index.php/$0 [PT]


Na hostingu jest podpięta jeszcze inna domena, na której działa Kohana w jakiejś starszej wersji z gałęzi 3.x, bootstrap i htaccess są ustawione tak samo, jak powyżej. W czym może być problem?


--------------------
www.swiths.com
Go to the top of the page
+Quote Post
r4xz
post 11.11.2012, 16:13:18
Post #2





Grupa: Zarejestrowani
Postów: 673
Pomógł: 106
Dołączył: 31.12.2008

Ostrzeżenie: (0%)
-----


"The requested URL / was not found on this server."
routing... albo nie masz zdefiniowanego dla "/", albo nie może znaleźć odp. akcji/kontrolera


--------------------
Go to the top of the page
+Quote Post
pifarek
post 11.11.2012, 16:39:18
Post #3





Grupa: Zarejestrowani
Postów: 91
Pomógł: 15
Dołączył: 3.03.2009
Skąd: Włocławek

Ostrzeżenie: (0%)
-----


Cytat(r4xz @ 11.11.2012, 16:13:18 ) *
routing... albo nie masz zdefiniowanego dla "/", albo nie może znaleźć odp. akcji/kontrolera

A coś więcej podpowiesz na ten temat?


--------------------
www.swiths.com
Go to the top of the page
+Quote Post
r4xz
post 11.11.2012, 20:45:37
Post #4





Grupa: Zarejestrowani
Postów: 673
Pomógł: 106
Dołączył: 31.12.2008

Ostrzeżenie: (0%)
-----


Cytat(pifarek @ 11.11.2012, 16:39:18 ) *
A coś więcej podpowiesz na ten temat?


to może zapytam tak, czy jeśli masz ustawienia domyślne (tj. kod poniżej) to masz ten błąd?
  1. Route::set('default', '(<controller>(/<action>(/<id>)))')
  2. ->defaults(array(
  3. 'controller' => 'welcome',
  4. 'action' => 'index',
  5. ));

+ w folderze application/classes/Controller/Welcome.php klasę class Controller_Welcome extends Controller z public function action_index()?

najlepiej pokaż swój routing i obiekt której dotyczy


--------------------
Go to the top of the page
+Quote Post
pifarek
post 11.11.2012, 21:05:48
Post #5





Grupa: Zarejestrowani
Postów: 91
Pomógł: 15
Dołączył: 3.03.2009
Skąd: Włocławek

Ostrzeżenie: (0%)
-----


u mnie to wygląda tak:
  1. Route::set('default', '(<action>)')
  2. ->defaults(array(
  3. 'controller' => 'index',
  4. 'action' => 'index',
  5. ));
  6.  
  7. Route::set('admin', 'admin/<action>')
  8. ->defaults(array(
  9. 'directory' => 'admin',
  10. 'controller' => 'index'
  11. ));
  12.  
  13. Route::set('feed', 'feed/<action>')
  14. ->defaults(array(
  15. 'directory' => 'feed',
  16. 'controller' => 'index',
  17. 'action' => 'index',
  18. ));
  19.  
  20. Route::set('news', 'news/<news>(/<action>)')
  21. ->defaults(array(
  22. 'directory' => 'news',
  23. 'controller' => 'index',
  24. 'action' => 'index',
  25. ));
  26.  
  27. Route::set('user', 'user/<username>(/<action>)')
  28. ->defaults(array(
  29. 'directory' => 'user',
  30. 'controller' => 'index',
  31. 'action' => 'index',
  32. ));
  33.  
  34. Route::set('user_ajax', 'user/ajax/<action>')
  35. ->defaults(array(
  36. 'directory' => 'user',
  37. 'controller' => 'ajax',
  38. 'action' => 'index',
  39. ));
  40.  
  41. Route::set('game', 'game/<game>(/<tab>)', array('tab' => 'play|report'))
  42. ->defaults(array(
  43. 'directory' => 'game',
  44. 'controller' => 'index',
  45. 'action' => 'index',
  46. ));
  47.  
  48. Route::set('game_ajax', 'game/ajax/<action>')
  49. ->defaults(array(
  50. 'directory' => 'game',
  51. 'controller' => 'ajax',
  52. 'action' => 'index',
  53. ));
  54.  
  55. Route::set('activate', 'activate,user.<username>,code.<code>')
  56. ->defaults(array(
  57. 'controller' => 'index',
  58. 'action' => 'activate',
  59. ));
  60.  
  61. Route::set('ajax', 'ajax/<action>')
  62. ->defaults(array(
  63. 'controller' => 'ajax',
  64. 'action' => 'index',
  65. ));

i wszystko działa na localhoscie :/


--------------------
www.swiths.com
Go to the top of the page
+Quote Post
r4xz
post 11.11.2012, 21:15:41
Post #6





Grupa: Zarejestrowani
Postów: 673
Pomógł: 106
Dołączył: 31.12.2008

Ostrzeżenie: (0%)
-----


1. a jak wygląda dostępność .htaccess w ustawieniach (obstawiam że) Apache?
2. żeby obalić teorię 1 sprawdź czy inne podstrony chodzą
3. upewnij się że istnieje w controller/index.php metoda action_index

Ten post edytował r4xz 11.11.2012, 21:17:20


--------------------
Go to the top of the page
+Quote Post
klocu
post 11.11.2012, 22:12:52
Post #7





Grupa: Zarejestrowani
Postów: 291
Pomógł: 45
Dołączył: 21.08.2007

Ostrzeżenie: (0%)
-----


Ja tylko dorzucę, bo sam to przerabiałem przy migracji:

Cytat
PSR-0 support (file/class naming conventions)
With the introduction of PSR-0 support, the autoloading of classes is case sensitive. Now, the file (and folder) names must match the class name exactly.


.htaccess nie zmieniał się od wielu wersji (chyba że ktoś używa możliwie nowej wersji apache'a, która Order Deny,Allow każe sobie zapisać inaczej - krócej)
Go to the top of the page
+Quote Post
gothye
post 12.11.2012, 09:31:45
Post #8





Grupa: Zarejestrowani
Postów: 702
Pomógł: 65
Dołączył: 16.03.2009

Ostrzeżenie: (0%)
-----


wyczyść cache


--------------------
Nie udzielam pomocy poprzez PW
Go to the top of the page
+Quote Post
pifarek
post 12.11.2012, 19:33:13
Post #9





Grupa: Zarejestrowani
Postów: 91
Pomógł: 15
Dołączył: 3.03.2009
Skąd: Włocławek

Ostrzeżenie: (0%)
-----


Cytat(klocu @ 11.11.2012, 22:12:52 ) *
Ja tylko dorzucę, bo sam to przerabiałem przy migracji:



.htaccess nie zmieniał się od wielu wersji (chyba że ktoś używa możliwie nowej wersji apache'a, która Order Deny,Allow każe sobie zapisać inaczej - krócej)

Wychodzi na to, że to właśnie tego wina. Ale nie podoba mi się, że muszę teraz każdy plik nazywać z dużej litery i miliard klas w kodzie typu url::base() zmieniać na URL::base() ohmy.gif !

Dzięki wszystkim!


--------------------
www.swiths.com
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 24.04.2025 - 06:21