Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]problem z Rewrite Rule
--Pawel--
post
Post #1





Goście







Witam
mam taki plik

.htaccess
  1. RewriteEngine On
  2.  
  3. RewriteCond %{REQUEST_FILENAME} !d
  4. RewriteCond %{REQUEST_FILENAME} !f
  5. RewriteCond %{REQUEST_FILENAME} !l
  6.  
  7. RewriteRule ^(.+) index.php?url=$1 [QSA,L]


jak teraz zrobić aby taki link
index.php?url=index/index/40
był przekształcany do
index/index/40
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
b4rt3kk
post
Post #2





Grupa: Zarejestrowani
Postów: 1 933
Pomógł: 460
Dołączył: 2.04.2010
Skąd: Lublin

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


Tak:

Kod
RewriteRule ^index/index/([0-9]+)$ index.php?url=index/index/$1


Poza tym nie link jest przekształcany, a odwrotnie - serwer interpretuje wpisany adres index/index/40 jako index.php?url=index/index/40.

Podejrzewam, że będziesz miał problemy chociażby z css, bo nie masz ustawionego RewriteBase.

Ten post edytował b4rt3kk 9.01.2013, 00:44:16
Go to the top of the page
+Quote Post

Posty w temacie
- -Pawel-   [PHP]problem z Rewrite Rule   8.01.2013, 23:17:20
- - b4rt3kk   Tak: KodRewriteRule ^index/index/([0-9...   9.01.2013, 00:43:25


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: 3.10.2025 - 12:20