Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [mod_rewrite] bezwzgledne przekierowanie,, statystyki strony
test30
post 21.06.2008, 11:19:11
Post #1





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 15.12.2007

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


witam,

w jaki sposob moge zrobc taka regule, ze kazdy adres bedzie najpierw przechodzil przez plik np redir.php
chodzi mi o to:
jesli uzytkownik wpisz w przegladarce
http://strona.pl/costam/bleble.php
to regula, nawet jesli plik 'costam/bleble.php' istnieje, to przekieruje na adres:
http://strona.pl/redir.php?pg=costam/bleble.php

bardzo przydatne byloby to do moich statystyk servera, kazda strona ile razy byla wyswietlna

doszedlem do takiego sformulwaonia, ale to sie zapetla w nieskonczonosc
Kod
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ /redir.php?pg=$1 [QSA,R]
Go to the top of the page
+Quote Post
tommy4
post 21.06.2008, 19:12:47
Post #2





Grupa: Zarejestrowani
Postów: 288
Pomógł: 12
Dołączył: 2.12.2005

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


Kod
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} (^redir\.php).* [NC]
RewriteRule ^(.*)$ /redir.php?pg=$1 [QSA,R]


Może jakoś tak?

EDIT: mam

Kod
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^redir\.php.* [NC]
RewriteRule ^(.*)$ /redir.php?pg=$1 [QSA,R]


http://home.pl/pomoc/2360

Ten post edytował tommy4 21.06.2008, 19:16:31
Go to the top of the page
+Quote Post
test30
post 21.06.2008, 19:39:27
Post #3





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 15.12.2007

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


niestety
;s

Kod
redir.php?pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=redir.php&pg=ng


takie zapetlenie wystepuje
kombinuej z tym rewritecond, ale nie wychodzi


#EDIT

  1. <?php
  2. RewriteEngine On
  3. RewriteBase /
  4. RewriteCond %{REQUEST_URI} !redir.php.* [NC]
  5. RewriteRule ^(.*)/redir.php?pg=$1 [QSA,R]
  6. ?>


prezentuje satystakcjonujace mnie dzialanie, dzieki wielkie za pomoc!

Ten post edytował test30 21.06.2008, 19:45: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.08.2025 - 11:09