![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 17 Pomógł: 1 Dołączył: 18.12.2009 Ostrzeżenie: (0%) ![]() ![]() |
Witam. Jak mogę w php generować przyjazne linki? Moje linki teraz wyglądają tak:
adresstrony.pl/readnews.pl?id=1 a chciałbym, żeby wyglądały tak: adresstrony.pl/tytulnewsa albo adresstrony.pl/news/tytulnewsa Newsy trzymam w MySQL. |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Moderatorzy Postów: 4 069 Pomógł: 497 Dołączył: 11.05.2007 Skąd: Warszawa ![]() |
Kod # Turn on URL rewriting RewriteEngine On # Installation directory RewriteBase / # Allow any files or directories that exist to be displayed directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Rewrite all other URLs to index.php/URL RewriteRule .* index.php/$0 [PT,L] Dane odbierasz przez $_SERVER['REQUEST_URI'] , potem robisz explode('/', $dane); . Oczywiście musisz sobie to jakoś rozwinąć od strony php. |
|
|
![]() ![]() |
![]() |
Aktualny czas: 11.10.2025 - 16:34 |