Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]problem z Rewrite Rule
--Pawel--
post 8.01.2013, 23:17:20
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
b4rt3kk
post 9.01.2013, 00:43:25
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


--------------------
Jeśli pomogłem, kliknij proszę 'pomógł'. Dzięki.
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: 19.07.2025 - 07:25