Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]Przekierowanie na podstrone, http://localhost/index.php -> http://localhost/index.php?id=main
jerry1984
post 15.05.2011, 12:42:41
Post #1





Grupa: Zarejestrowani
Postów: 38
Pomógł: 3
Dołączył: 4.12.2010

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


Witam

Mam problemy z przekierowaniem z http://localhost/index.php na podstronę http://localhost/index.php?id=main .

Używałem wielu kombinacji:

.htaccess
Kod
Redirect permanent http://localhost/index.php  http://localhost/index.php?id=main


meta
Kod
<META HTTP-EQUIV=Refresh CONTENT=?0; URL=http://localhost/index.php?id=main?>

działa lecz mam nieskończoną pętle odświeżania strony.

php
Kod
<?
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://localhost/index.php?id=main");
header("Connection: close");
?>


Kurcze już mnie się pomysły kończą i odwiedzane strony.
Proszę o jakieś nakierowanie lub podpowiedz.

Z góry dziękuje

Ten post edytował jerry1984 15.05.2011, 12:44:18
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
melkorm
post 15.05.2011, 16:30:15
Post #2





Grupa: Zarejestrowani
Postów: 1 366
Pomógł: 261
Dołączył: 23.09.2008
Skąd: Bydgoszcz

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


to daj ./index.php


--------------------
Go to the top of the page
+Quote Post
jerry1984
post 15.05.2011, 16:39:29
Post #3





Grupa: Zarejestrowani
Postów: 38
Pomógł: 3
Dołączył: 4.12.2010

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


Cytat(melkorm @ 15.05.2011, 17:30:15 ) *
to daj ./index.php


już lepiej, strona się wczytuje bez błędów, lecz bez przekierowania.
Próbowałem też dać tak :

Kod
RewriteEngine On
RewriteRule ./index.php$ ./index.php?id=main [NC,L]


i też nic.
Go to the top of the page
+Quote Post

Posty w temacie


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: 14.08.2025 - 22:38