Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Dyrektywa DirectoryIndex, RewriteRule w .htaccess
Forum PHP.pl > Forum > Przedszkole
bovtek8
Witam, w jaki sposób połączyć w pliku .htaccess oba skrypty DirectoryIndex, RewriteRule ?

Dodając w dowolnym miejscu DirectoryIndex glowna.html zawsze otwiera się plik index.php a nie glowna.html

  1.  
  2. RewriteEngine On
  3.  
  4. #########################################################################
  5. # Module: Objects Managment
  6. #########################################################################
  7.  
  8. RewriteRule ^wojewodztwo-([a-z-]+)\.html$ index.php?rewrite=true&state=$1 [L]
  9. RewriteRule ^search\.html$ index.php?rewrite=true&searchEngine=true [QSA]
  10. RewriteRule ^([a-z0-9-]+),([0-9]+),podglad,([a-z]+)\.html$ index.php?rewrite=true&object=$2&bookmark=$3 [L]
  11. RewriteRule ^([a-z0-9-]+),([0-9]+),podglad\.html$ index.php?rewrite=true&object=$2&bookmark=opis [L]
  12.  
  13. RewriteRule ^platnosci\/([a-z-]+)\/([a-z-]+)\.html$ modules/platnosci.php?rewrite=true&action=$1&type=$2 [QSA]
  14.  
  15. RewriteRule ^obiekt\/([a-z-]+)\/([^.]+)\/$ modules/objects.php?rewrite=true&action=$1&id=$2 [QSA]
  16. RewriteRule ^obiekt\/([a-z-]+)\/$ modules/objects.php?rewrite=true&action=$1 [QSA]
  17.  
  18. RewriteRule ^$ index.php?rewrite=true&startpage=initialize [QSA]
  19. RewriteRule ^start\.html$ index.php?rewrite=true&startpage=initialize [L]
  20. RewriteRule ^news\.html$ modules/news.php?rewrite=true&action=list [L]
  21. RewriteRule ^([a-z-]+)\.html$ index.php?rewrite=true&content=$1 [L]
  22.  
  23. ################################################################################
    ####################################
  24. # Module: News
  25. ################################################################################
    ####################################
  26.  
  27. RewriteRule ^news\/view\/([0-9]+),([^.]+)\/$ modules/news.php?rewrite=true&action=view&id=$1 [L]
  28. RewriteRule ^admin\/news\/$ modules/news.php?rewrite=true&admin=true&action=list [L]
  29. RewriteRule ^admin\/news\/add\/$ modules/news.php?rewrite=true&admin=true&action=add&id=$1 [L]
  30. RewriteRule ^admin\/news\/edit\/([0-9]+)\/$ modules/news.php?rewrite=true&admin=true&action=edit&id=$1 [L]
  31. RewriteRule ^admin\/news\/delete\/([0-9]+)\/$ modules/news.php?rewrite=true&admin=true&action=delete&id=$1 [L]
  32.  
  33. #########################################################################
  34. # Module: Users
  35. #########################################################################
  36.  
  37. RewriteRule ^user\/activate\/([^.]+)$ modules/users.php?rewrite=true&action=activate&ident=$1 [L]
  38. RewriteRule ^user\/([a-z-]+)\/$ modules/users.php?rewrite=true&action=$1 [QSA]
  39.  
  40. #########################################################################
  41. # Module: Administration
  42. #########################################################################
  43.  
  44. RewriteRule ^admin\/$ modules/admin.php?rewrite=true&action=start [L]
  45. RewriteRule ^admin\/([a-z-]+)\/$ modules/admin.php?rewrite=true&action=$1 [QSA]
  46. RewriteRule ^admin\/([a-z-]+)\/([a-z-]+)\.html$ modules/admin.php?rewrite=true&action=$1&type=$2 [QSA]
  47. RewriteRule ^admin\/([a-z-]+)\/([^.]+)\/$ modules/admin.php?rewrite=true&action=$1&id=$2 [QSA]
  48.  
  49. #########################################################################
  50. # Module: Grupy
  51. #########################################################################
  52.  
  53. RewriteRule ^grupy\/([a-z]+)\.html$ modules/groups/groups.php?rewrite=true&action=$1 [QSA]
  54. RewriteRule ^grupy\/([a-z]+)\/([0-9]+),([^.]+)\.html$ modules/groups/groups.php?rewrite=true&action=$1&gid=$2 [QSA]
  55. RewriteRule ^posty\/([0-9]+),([0-9]+),([^.]+)\.html$ modules/groups/groups.php?rewrite=true&action=posty&gid=$1&tid=$2 [QSA]
  56. RewriteRule ^posty\/([a-z]+)\/([0-9]+),([0-9]+),([^.]+)\.html$ modules/groups/groups.php?rewrite=true&action=posty&method=$1&gid=$2&tid=$3 [QSA]
  57.  
  58.  
  59. ################################################################################
    ####################################
  60. # Module: Newsletter
  61. ################################################################################
    ####################################
  62.  
  63. RewriteRule ^newsletter\/([a-z]+)\.html$ modules/newsletter.php?rewrite=true&action=$1 [QSA]
  64. RewriteRule ^newsletter\/admin\/([a-z-]+)\.html$ modules/newsletter.php?rewrite=true&action=$1 [QSA]
  65.  
  66.  
Crozin
1. W plikach .htaccess nie ma skryptów
2. W czym problem?
Kod
DirectoryIndex abc.def index.php
RewriteEngine On
...
bovtek8
Cytat(Crozin @ 11.09.2010, 22:19:49 ) *
1. W plikach .htaccess nie ma skryptów
2. W czym problem?
Kod
DirectoryIndex abc.def index.php
RewriteEngine On
...


Jest wpisane tak:
DirectoryIndex glowna.html index.php
RewriteEngine On
.
.
.

i nadal otwiera się jako pierwsze index.php a nie glowna.html
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.