Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [inne]Mod_rewrite - jeden prosty przykład [?], Coś robię źle... Pomożecie?
-PomocnyGosc-
post 25.06.2012, 14:54:36
Post #1





Goście







Witam,

Chodzi o to żeby przekierowywało z:

http://localhost/mineshafter/game/checkserver?zmienna1=wartosc1&zmienna2=wartosc2
(bez .php)

na

http://localhost/mineshafter/game/checkserver.php?zmienna1=wartosc1&zmienna2=wartosc2

Próbowałem wiele razy, ale coś mi nie wychodzi...
Napisałby mi ktoś jak taki .htaccess miałby wyglądać?
Go to the top of the page
+Quote Post
Giluś
post 25.06.2012, 15:41:03
Post #2





Grupa: Zarejestrowani
Postów: 377
Pomógł: 9
Dołączył: 2.11.2010

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


A zrób tak:

RewriteRule ^checkserver.php?zmienna1-([^-]+)-zmienna2-([^-]+).htm$ checkserver?zmienna1=$1&zmienna2=$2 [L]
Go to the top of the page
+Quote Post
-PomocnyGosc-
post 25.06.2012, 18:02:19
Post #3





Goście







Niestety nie działa sad.gif
Go to the top of the page
+Quote Post
webdice
post 25.06.2012, 18:07:42
Post #4


Developer


Grupa: Moderatorzy
Postów: 3 045
Pomógł: 290
Dołączył: 20.01.2007




Kod
RewriteRule ^checkserver$ checkserver.php [QSA]
Go to the top of the page
+Quote Post
GoOx
post 25.06.2012, 18:43:52
Post #5





Grupa: Zarejestrowani
Postów: 329
Pomógł: 6
Dołączył: 23.11.2011
Skąd: Łódź

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


RewriteRule ^checkserver$ checkserver.php [QSA]

wystarczy

RewriteRule ^checkserver$ checkserver.php [L]
Go to the top of the page
+Quote Post
-PomocnyGosc-
post 26.06.2012, 15:57:07
Post #6





Goście







I wyskakuje error 500. Mod_rewrite jest zainstalowane i np. index.php -> inex.html działa ;/
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 Wersja Lo-Fi Aktualny czas: 20.07.2025 - 07:09