Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP].htaccess problem z mod_rewrite
northwest
post
Post #1





Grupa: Zarejestrowani
Postów: 788
Pomógł: 1
Dołączył: 17.09.2004

Ostrzeżenie: (10%)
X----


Witam,
mam następujący plik .htaccess:
RewriteEngine On
RewriteRule ^index/([^-]+)/([^-]+)/([^-]+).html$ index.php?peta=$1&lista=$2 [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
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 11)
Pitter
post
Post #2





Grupa: Zarejestrowani
Postów: 75
Pomógł: 8
Dołączył: 9.08.2008

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


A dlaczego dwa razy napisałeś to samo?
RewriteRule ^index/([^-]+)/([^-]+)/([^-]+).html$ index.php?peta=$1&lista=$2 [L]
po co to podkreślone? Przecież podajesz tylko dwie zmienne w adresie prawdziwym a tam wpisałeś że ma zastępować trzy. Nie znam się za dobrze ale raczej o to chodzi. Pozdrawiam Pitter

Ten post edytował Pitter 9.08.2008, 21:39:54
Go to the top of the page
+Quote Post
northwest
post
Post #3





Grupa: Zarejestrowani
Postów: 788
Pomógł: 1
Dołączył: 17.09.2004

Ostrzeżenie: (10%)
X----


Poprawiłem na coś takiego:
RewriteEngine On
RewriteRule ^index/([^-]+).html$ index.php?peta=$1 [L]

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


ale dalej nie działa sad.gif(
Go to the top of the page
+Quote Post
shazarre
post
Post #4





Grupa: Zarejestrowani
Postów: 8
Pomógł: 1
Dołączył: 9.08.2008

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


Kod
RewriteEngine On
RewriteRule ^index/([^-]+).html$ index.php?peta=$1
RewriteRule ^index2/([^-]+)/([^-]+).html$ index.php?peta=$1&lista=$2 [L]
Go to the top of the page
+Quote Post
northwest
post
Post #5





Grupa: Zarejestrowani
Postów: 788
Pomógł: 1
Dołączył: 17.09.2004

Ostrzeżenie: (10%)
X----


nie działa:(
Go to the top of the page
+Quote Post
Kenexos
post
Post #6





Grupa: Zablokowani
Postów: 60
Pomógł: 0
Dołączył: 6.08.2008
Skąd: Gdynia

Ostrzeżenie: (20%)
X----


Polecam ci ten poradnik!
Właśnie go przeczytałem sprawdziłem czy u mnie działa i hura!! Działa!
A jeszcze dzisiaj rano miałem taki problem jak ty na xampp!!;]
O to ten poradnik:
http://doc.piecyk.org/modRewrite.pdf
Go to the top of the page
+Quote Post
northwest
post
Post #7





Grupa: Zarejestrowani
Postów: 788
Pomógł: 1
Dołączył: 17.09.2004

Ostrzeżenie: (10%)
X----


przeczytałem ten artykuł, ale dalej nie wiem co jest źle:( według tych opisów mój przykład jest okey...:/
a mod rewrite działa na 100%..
takie coś u mnie działa:
RewriteEngine On
RewriteRule ^index2/([^-]+)/([^-]+).html$ index.php?peta=$1&lista=$2 [L]

tylko z 2 nie chce;/
Go to the top of the page
+Quote Post
Kenexos
post
Post #8





Grupa: Zablokowani
Postów: 60
Pomógł: 0
Dołączył: 6.08.2008
Skąd: Gdynia

Ostrzeżenie: (20%)
X----


masz to na xampp?? to odblokuj w apache mod rewrite
Go to the top of the page
+Quote Post
northwest
post
Post #9





Grupa: Zarejestrowani
Postów: 788
Pomógł: 1
Dołączył: 17.09.2004

Ostrzeżenie: (10%)
X----


to jest apache.
mod rewrite działa na 100%..
takie coś u mnie działa:
RewriteEngine On
RewriteRule ^index2/([^-]+)/([^-]+).html$ index.php?peta=$1&lista=$2 [L]

tak wygląda mój plik: www.udanewakacje.net/nowy/test.txt
Go to the top of the page
+Quote Post
Pitter
post
Post #10





Grupa: Zarejestrowani
Postów: 75
Pomógł: 8
Dołączył: 9.08.2008

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


ALe dalej ci się wyświetla błąd czy po prostu nie przekierowuje?
Go to the top of the page
+Quote Post
northwest
post
Post #11





Grupa: Zarejestrowani
Postów: 788
Pomógł: 1
Dołączył: 17.09.2004

Ostrzeżenie: (10%)
X----


ciągle ten sam błąd... :/

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:)))
Go to the top of the page
+Quote Post
henio
post
Post #12





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

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


Plik .htaccess
  1. <?php
  2. Options FollowSymLinks
  3. RewriteEngine On
  4.  
  5. # Zmiana na przyjazne adresy w skrypcie dotycz&plusmn;cym strony głównej
  6. RewriteRule ^index.html$ index.php
  7.  
  8. # Zmiana na przyjazne adresy w skrypcie dotycz&plusmn;cym newsów
  9. RewriteRule ^pokaz-news-(.+)-(.+).html$ pokaz_news.php?id_news=$1&tytul=$2
  10. ?>


Nie jestem specjalistą od wyrażeń regularnych, ale szukałem w internecie jak zamienić ciąg "ble ble ble" na "ble-ble-ble" ale nie znalazłem. Pytam się więc o jakiś link do artykułu opisującego taką zamianę o jaką mi chodzi.

Ten post edytował henio 17.08.2008, 14:22:58
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 Aktualny czas: 22.08.2025 - 04:23