Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [htaccess] Problem z przepisywaniem adresow
karmelik
post 8.04.2015, 08:39:10
Post #1





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 2.12.2014

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


Witam,

mam dwa uklady stron:

http://strona.pl/krzesla.html
http://strona.pl/krzesla.html?strona=5

w htaccess musze zrobic zeby wszystko kierowalo na index.php, wyciagalo kategorie i numer podstrony jesli jest, wiec mam:
Kod
RewriteEngine on
DirectoryIndex index.php
RewriteCond $1 !^(index\.php|templatka|sitemap\.xml\.gz|robots\.txt|google*\.html)

RewriteRule ^([a-zA-Z0-9]+).html?page=([0-9]+)$ index.php?kategoria=$1&page=$2
RewriteRule ^([a-zA-Z0-9]+).html$ index.php?kategoria=$1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]



teraz jak wchodze na http://strona.pl/krzesla.html oraz jak wchodze na http://strona.pl/krzesla.html?strona=5 jest to samo:
Kod
Array
(
    [kategoria] => krzesla
)



Ale jak zakomentuje linijke:
Kod
RewriteRule ^([a-zA-Z0-9]+).html$ index.php?kategoria=$1


w stronie http://strona.pl/krzesla.html gdy wyswietlam $_GET mam:
Kod
Array
(
    [/krzesla_html] =>
)


na stronie http://strona.pl/krzesla.html?strona=5 dane $_GET zawieraja:
Kod
Array
(
    [/krzesla_html] =>
    [page] => 5
)


nie mam zielonego pojecia dla czego nie pobiera prawidlowo kategorii. Prosze o jakas podpowiedz chociaz co zle tutaj robie ...
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 - 18:56