Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> htaccess i rewrite rule problem
--newbie--
post
Post #1





Goście







Witam,

zdefiniowałem prostą regułę w pliku htaccess

RewriteEngine On
RewriteRule /(testy)/([0-9]+) /testy.php?news=$1

po wywołaniu strony
http://localhost/testy.php?news=3

efekt żaden. Czy robię coś nie tak? np. access deny funkcjonuje ok, więc apache musi być skonfigurowany właściwie.

Pozdrawiam
nb
Go to the top of the page
+Quote Post
Neeke
post
Post #2





Grupa: Zarejestrowani
Postów: 124
Pomógł: 16
Dołączył: 22.02.2007
Skąd: Warszawa

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


wpisz link http://localhost/testy/news-3 bo robisz przyjazneadresy
Go to the top of the page
+Quote Post
sobstel
post
Post #3





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

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


regula powinna wygladac tak
Kod
RewriteRule /testy/([0-9]+) /testy.php?news=$1


albo tak

Kod
RewriteRule /(testy)/([0-9]+) /testy.php?news=$2


wtedy po wpisaniu np. /testy/4 bedzie uruchamial /testy.php?news=4

ale jak nie dziala http://localhost/testy.php?news=3 to nic z tego. innymi slowy, tu wyglada, ze problem tkwi w samym skrypcie testy.php, a nie w konfiguracji apache'a.


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
Go to the top of the page
+Quote Post
--newbie--
post
Post #4





Goście







Problem tkwił w mojej głowie. Dziękuję za pomoc.

Pozdrawiam
nb
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: 19.08.2025 - 05:47