Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> format adresu w php
stroju
post 17.11.2005, 16:16:36
Post #1





Grupa: Zarejestrowani
Postów: 179
Pomógł: 2
Dołączył: 17.11.2005

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


witam. normalnie uwzględniając zmienne w adresie wyglada to tak cos.php?id=20&site=kom na tomoast zastanawia mnie jak zrobic format adresu na cos/id/20/site/kom lub cos podobnego do tego(chodzi mi o ukośniki zamiast np znaku = ).
Go to the top of the page
+Quote Post
mike
post 17.11.2005, 17:23:35
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


Temat poruszany na forum bardzo często.
Prosze poszukać pod słowami kluczowymi: nice URL's, przyjazne URL'a.

Już nawet nie mówię o artykule na php.pl: Przyjazne URLe.
Go to the top of the page
+Quote Post
Fipaj
post 17.11.2005, 17:26:53
Post #3





Grupa: Zarejestrowani
Postów: 691
Pomógł: 0
Dołączył: 19.01.2005
Skąd: Warszawa

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


jest o tym artykuł w wortalu smile.gif

nice url's winksmiley.jpg


--------------------
Go to the top of the page
+Quote Post
stroju
post 19.11.2005, 10:54:00
Post #4





Grupa: Zarejestrowani
Postów: 179
Pomógł: 2
Dołączył: 17.11.2005

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


robie tak jak jest podane w tym arcie ale i tak linki nie działają.
Go to the top of the page
+Quote Post
Sabistik
post 19.11.2005, 11:13:32
Post #5


Administrator wortalu


Grupa: Przyjaciele php.pl
Postów: 960
Pomógł: 39
Dołączył: 21.10.2003
Skąd: Kraków

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


RTFM. Nie jestesmy wszechwiedzacy Druchii.
Jesli oczekujesz pomocy potrzebujemy wiecej informacji.. jak wykorzystujesz kod, w jaki sposob objawia sie problem..

Mozesz tez wykorzstac do tworzenia url`i mod_rewrite.
Go to the top of the page
+Quote Post
stroju
post 19.11.2005, 12:32:54
Post #6





Grupa: Zarejestrowani
Postów: 179
Pomógł: 2
Dołączył: 17.11.2005

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


po dłygich zastanowieniach swierdziłem ze moga byc normalne adresy ze zmiennymi.
Go to the top of the page
+Quote Post
dtb
post 19.11.2005, 12:39:07
Post #7





Grupa: Zarejestrowani
Postów: 476
Pomógł: 1
Dołączył: 5.11.2005
Skąd: Bieruń city

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


.htacces:

RewriteEngine On
RewriteRule ^index.html$ index.php
RewriteRule ^index-([^\.]*).html$ index.php?p1=$1
RewriteRule ^index-([^-]*)-([^\.]*).html$ index.php?p1=$1&p2=$2
RewriteRule ^index-([^-]*)-([^-]*)-([^\.]*).html$ index.php?p1=$1&p2=$2&p2=$3

teraz mamy adresy:
index.html - index.php
index-01.html - index.php?p1=01
index-01-02.html - index.php?p1=01&p2=02
index-01-02-03.html - index.php?p1=01&p2=02&p3=03

ładne url'e i nie ma problemów z linkami

Ten post edytował dtb 19.11.2005, 12:42:20


--------------------
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: 14.07.2025 - 23:01