Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [mod_rewrite] Problem z linkami
thomson89
post
Post #1





Grupa: Zarejestrowani
Postów: 1 178
Pomógł: 51
Dołączył: 7.01.2009
Skąd: Gdańsk

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


Witam!

Zacząłem swoją przygodę z mod_rewrite i potrzebuje pomocy. Otóż, mam takie linki:
  1. <a href="index">Strona główna</a> |
  2. <a href="produkt/1">Produkt 1</a> |
  3. <a href="produkt">Produkty</a>

I .htaccess:
Kod
RewriteEngine On
RewriteRule ^produkty$ index.php?dzial=produkt
RewriteRule ^produkt/([0-9])$ index.php?dzial=produkt&id=$1
RewriteRule ^index$ index.php


Jak jest link w postaci: http://adres.pl/folder/ to wyświetla się index.
Jak kliknę, np. na produkt 1 wyświetla się produkt 1, postać linku: http://adres.pl/folder/podukt/1
A jak znowu kliknę na coś, to dopisują się regułki, czyli: http://adres.pl/folder/produkt/1/produkt/1

Jak to naprawić?

EDIT: Dodałem RewriteBase /folder i nadal to samo.

Ten post edytował thomson89 3.08.2010, 17:02:11
Go to the top of the page
+Quote Post
zelu
post
Post #2





Grupa: Zarejestrowani
Postów: 229
Pomógł: 34
Dołączył: 7.12.2008
Skąd: Poznań

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


  1. <base href="http://example.com/folder/" />
Go to the top of the page
+Quote Post
thomson89
post
Post #3





Grupa: Zarejestrowani
Postów: 1 178
Pomógł: 51
Dołączył: 7.01.2009
Skąd: Gdańsk

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


Dzięki!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.12.2025 - 20:23