Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Kohana]pozbycie się index.php
Spawnm
post 15.05.2009, 19:42:35
Post #1





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




witam , właśnie testuję kohane na localu i moje pytanie to jak pozbyć się z linku index.php ?
to imho brzydko wygląda strona z linkiem :
http://127.0.0.1/kkohana/Kohana/index.php/home/page/tresc
chciałbym aby było zwykłe
http://127.0.0.1/kkohana/Kohana/home/page/tresc

gdzieś to można usunąć ?
Go to the top of the page
+Quote Post
JoShiMa
post 15.05.2009, 20:26:57
Post #2





Grupa: Zarejestrowani
Postów: 1 374
Pomógł: 149
Dołączył: 1.03.2006

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


.htaccess

smile.gif


--------------------
Go to the top of the page
+Quote Post
Spawnm
post 15.05.2009, 20:47:27
Post #3





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




a można dokładniej

bo po usunięciu tego nic się nie zmieniło:
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]
Go to the top of the page
+Quote Post
magnus
post 15.05.2009, 22:04:01
Post #4





Grupa: Zarejestrowani
Postów: 99
Pomógł: 15
Dołączył: 15.11.2007
Skąd: Nowogród Bobrz.

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


Kod
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [PT,L]


--------------------
Efemental.pl - nasz punkt słyszenia :: recenzje :: tylko metal!
Opensource'owy klon Cantra: http://github.com/magnax/Simtr
Go to the top of the page
+Quote Post
henio
post 10.07.2009, 20:30:51
Post #5





Grupa: Zarejestrowani
Postów: 237
Pomógł: 1
Dołączył: 15.10.2004
Skąd: Lublin

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


Zastosowałem podany tutaj kod, ale kiedy umieściłem pliki w internecie pojawił mi się błąd: No input file specified.

Dodam jeszcze, że na localhoscie działa mi bez zarzutu.
Go to the top of the page
+Quote Post
b4x
post 10.07.2009, 20:57:51
Post #6





Grupa: Zarejestrowani
Postów: 658
Pomógł: 95
Dołączył: 20.12.2005
Skąd: N54,35° E18,63° (Gdańsk)

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


A na jakim serwerze masz ? ;-) (nginx?) [na zewn.]


--------------------
Go to the top of the page
+Quote Post
bełdzio
post 10.07.2009, 22:10:40
Post #7





Grupa: Zarejestrowani
Postów: 690
Pomógł: 81
Dołączył: 6.04.2005
Skąd: Szczecin

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


a wyczyściłeś $config['index_page'] ?


--------------------
Go to the top of the page
+Quote Post
henio
post 11.07.2009, 09:00:25
Post #8





Grupa: Zarejestrowani
Postów: 237
Pomógł: 1
Dołączył: 15.10.2004
Skąd: Lublin

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


  1. <?php
  2. $config['index_page'] = NULL;
  3. ?>
Go to the top of the page
+Quote Post
Villentre
post 11.07.2009, 11:20:56
Post #9





Grupa: Zarejestrowani
Postów: 21
Pomógł: 10
Dołączył: 14.10.2008
Skąd: 127.0.0.1

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


Witam.

Winny jest plik .htacces, spróbuj z taką konfiguracją:
Kod
# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Protect application and system files from being viewed
RewriteRule ^(application|modules|system) - [F,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 .* index.php?kohana_uri=$0 [PT,L,QSA]
Go to the top of the page
+Quote Post
henio
post 11.07.2009, 12:37:41
Post #10





Grupa: Zarejestrowani
Postów: 237
Pomógł: 1
Dołączył: 15.10.2004
Skąd: Lublin

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


Cytat(Villentre @ 11.07.2009, 12:20:56 ) *
Witam.

Winny jest plik .htacces, spróbuj z taką konfiguracją:
Kod
# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Protect application and system files from being viewed
RewriteRule ^(application|modules|system) - [F,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 .* index.php?kohana_uri=$0 [PT,L,QSA]


Dzieki, problem rozwiązany. Wcisnąłbym pomógł, ale to nie mój wątek
Go to the top of the page
+Quote Post
bliitz
post 8.12.2009, 16:26:38
Post #11





Grupa: Zarejestrowani
Postów: 155
Pomógł: 12
Dołączył: 5.04.2008

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


Witam

odświeżę ten wątek bo mam podobny problem. Plik .htaccess zaczerpnięty ze strony Kohany wygląda następująco:

  1. # Turn on URL rewriting
  2. RewriteEngine On
  3.  
  4. # Put your installation directory here:
  5. # If your URL is www.example.com/kohana/, use /kohana/
  6. # If your URL is www.example.com/, use /
  7. RewriteBase /kohana_rugby/
  8.  
  9. # Protect application and system files from being viewed
  10. RewriteCond $1 ^(application|system)
  11.  
  12. # Rewrite to index.php/access_denied/URL
  13. RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
  14.  
  15. # Allow these directories and files to be displayed directly:
  16. # - index.php (DO NOT FORGET THIS!)
  17. # - robots.txt
  18. # - favicon.ico
  19. # - Any file inside of the media/images/, media/js/, or media/css/ directories
  20. RewriteCond $1 ^(index\.php|robots\.txt|favicon\.ico|media/images|media/js|media/css)
  21.  
  22. # No rewriting
  23. RewriteRule ^(.*)$ - [PT,L]
  24.  
  25. # Rewrite all other URLs to index.php/URL
  26. RewriteRule ^(.*)$ index.php/$1 [PT,L]


na Windowsie xp działa bez problemu natomiast w przypadku ubuntu 9.10 nie chce działać
w phpinfo widzę, że załadowany jest w apachu moduł mod_rewrite
próbowałem też podmienić htaccess na ten podany w tym wątku i nic problem ten sam
Może ktoś miał podobny problem i udało się rozwiązać ?


--------------------
Go to the top of the page
+Quote Post
r-a-f-a-l
post 28.07.2010, 21:31:50
Post #12





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 28.07.2010

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


może jeszcze kiedyś sie komus przyda więc
może być że masz źle ustawioną ścieżkę
Mi pomogło jak ustawiłem w bootstrap i .htaccess scieżke

# Installation directory
RewriteBase /moja/kohana/

Kohana::init(array(
'base_url' => '/moje/kohana/',
'index_file' => ''
));
Go to the top of the page
+Quote Post
crackcomm
post 28.07.2010, 22:17:42
Post #13





Grupa: Zarejestrowani
Postów: 184
Pomógł: 6
Dołączył: 23.02.2008
Skąd: Katowice

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


w base_url masz index.php, wstaw "/kkohana/Kohana/"


--------------------
Sygnaturka comes here.
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: 31.07.2025 - 07:59