Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [Kohana]pozbycie się index.php
Forum PHP.pl > Forum > PHP > Frameworki
Spawnm
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ąć ?
JoShiMa
.htaccess

smile.gif
Spawnm
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]
magnus
Kod
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [PT,L]
henio
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.
b4x
A na jakim serwerze masz ? ;-) (nginx?) [na zewn.]
bełdzio
a wyczyściłeś $config['index_page'] ?
henio
  1. <?php
  2. $config['index_page'] = NULL;
  3. ?>
Villentre
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]
henio
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
bliitz
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ć ?
r-a-f-a-l
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' => ''
));
crackcomm
w base_url masz index.php, wstaw "/kkohana/Kohana/"
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.