.htaccess problem z mod_rewrite

Witam,

mam następujący plik .htaccess:

RewriteEngine On

RewriteRule ^index/([^-]+).html$ index.php?peta=$1 [L]

RewriteRule ^index2/([^-]+)/([^-]+)/([^-]+).html$ index.php?peta=$1&lista=$2 [L]

Nie wiem czemu, ale serwer ciągle mi zwraca błąd:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@bla.pl and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Wiecie może co robię źle??

Z góry dzięki za pomoc,

pozdrawiam Northwest

Powinno działać …o ile dobrze wpisałeś ścieżke.

…ale skoro nie działa, to możliwe że musisz skorzystać z rewritebase http://www.google.com/search?hl=pl&clie … se&spell=1

to chyba nie to:( bo jak zostawie np samo:

RewriteEngine On

lub

RewriteRule ^index2/([^-]+)/([^-]+)/([^-]+).html$ index.php?peta=$1&lista=$2 [L]

to działa…:confused:

a jak mam 2 reguły to nie chce:///

Na końcu pliku masz pusta linijkę?

tak wygląda mój plik: www.udanewakacje.net/nowy/test.txt

Plik .htaccess o takiej treści powinien działać

RewriteEngine On

RewriteRule ^index/([^-]+).html$ index.php?peta=$1 [L]

RewriteRule ^index2/([^-]+)/([^-]+).html$ index.php?peta=$1&lista=$2 [L]

…sprawdzałem u siebie i śmigało.

Z tego co piszesz wynika że sama reguła index2 działa, a obie razem już nie. Czy sama index też działa?

Na początku miałeś błąd 404 - czyli niepoprawna ścieżka, brak pliku. Nie możesz mieć katalogów o nazwie index i index2 - to cyba wiadome. Nie napisałeś jakimi urlami testujesz działanie tego mod_rewrite.

Jeżeli obie reguły osobno działają a użyte razem już nie, to kombinuj z flagami.

RewriteEngine On

RewriteRule ^([a-z0-9-_]+)/([a-z0-9-_]+)/([a-z0-9-_]+).html$ index.php?peta=$1&woj=$2&modrw [L]

RewriteRule ^([a-z0-9-_]+)/([a-z0-9-_]+).html$ index.php?peta=$1&modrw [L]

zaskoczyło coś takiego, dzięki za pomoc:)))