Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [inne] mod_rewrite czyta tylko 1 regułe
deadwheel
post
Post #1





Grupa: Zarejestrowani
Postów: 26
Pomógł: 2
Dołączył: 8.11.2011

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


Problem polega na tym ze gdy daje sobie 2 reguly podobne do siebie np

Kod
RewriteRule ^/?([a-z]*)/([a-z]*)/([0-9]*)\.html$ index.php?site=$1&action=$2&id=$3 [NC]
RewriteRule ^/?([a-z]*)/([a-z]*)/([0-9]*)\.html$ index.php?site=$1&action=$2&newsID=$3 [NC]


i zawsze bierze ten kod na gorze a nie obydwa i moje pytanie jak temu zaradzic ?

Moj caly htacces

Kod
RewriteEngine On

RewriteBase /
RewriteRule ^/?([a-z]*)/$ index.php?site=$1 [NC]
RewriteRule ^([^/]*)/([^/]*)\.html$ index.php?site=$1&picID=$2 [NC]
RewriteRule ^/?([a-z]*)/([a-z]*)/([0-9]*)\.html$ index.php?site=$1&action=$2&id=$3 [NC]
RewriteRule ^/?([a-z]*)/([a-z]*)/([0-9]*)\.html$ index.php?site=$1&action=$2&newsID=$3 [NC]


Nawet jak zmienie kawalek po lewej np bedzie to wygladalo tak:
Kod
RewriteRule ^/?([a-z]*)/([a-z]*)/([0-9]*)\.html$ index.php?site=$1&action=$2&id=$3 [NC]
RewriteRule ^/?([a-z]*)/([a-z]*)/([0-9]*)/$ index.php?site=$1&action=$2&newsID=$3 [NC]


To i tak wezmie tylko ta regulke na gorze .

Ten post edytował deadwheel 24.04.2013, 18:43:04
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
deadwheel
post
Post #2





Grupa: Zarejestrowani
Postów: 26
Pomógł: 2
Dołączył: 8.11.2011

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


Kolego nie masz 100% racji . Problem jest taki ze nie rozpoznaje on roznicy miedzy

tym
Kod
RewriteRule ^/?([a-z]*)/([a-z]*)/([0-9]*)\.html$ index.php?site=$1&action=$2&id=$3 [NC]

a tym
Kod
RewriteRule ^/?([a-z]*)/([a-z]*)/([0-9]*)\.html$ index.php?site=$1&action=$2&newsID=$3 [NC]


i trzeba zrobic cos takiego np
Kod
RewriteRule ^([^/]*)/([^/]*)/newsID/([^/]*)\.html$ /?site=$1&action=$2&newsID=$3 [NC]
RewriteRule ^([^/]*)/([^/]*)/id/([^/]*)\.html$ /?site=$1&action=$2&id=$3 [NC]


I teraz pieknie dziala

Dzieki za checi a tak przy okazji nie zakladajac nowego tematu ktos z was moze wie czemu jak daje w sekcji head znacznik base i moj link to wczytuje mi strone parenascie razy ta sama ?

Edit: // Kolejny problem z mod_rewrite
Kod
RewriteEngine On
RewriteBase /
RewriteRule ^([a-z]*)\.html$ index.php?site=$1 [NC]
RewriteRule ^([^/]*)/cwID/([^/]*)\.html$ /?site=$1&cwID=$2 [NC]
RewriteRule ^([^/]*)/newsID/([^/]*)\.html$ /?site=$1&newsID=$2 [NC]
RewriteRule ^([^/]*)/action/([^/]*)\.html$ index.php?site=$1&action=$2 [NC]
RewriteRule ^([^/]*)/galleryID/([^/]*)\.html$ /?site=$1&galleryID=$2 [NC]
RewriteRule ^([^/]*)/picID/([^/]*)\.html$ /?site=$1&picID=$2 [NC]
RewriteRule ^([^/]*)/cwID/([^/]*)\.html$ /?site=$1&cwID=$2 [NC]
RewriteRule ^([^/]*)/id/([^/]*)\.html$ /?site=$1&id=$2 [NC]
RewriteRule ^([^/]*)/mailkey/([^/]*)\.html$ /?site=$1&mailkey=$2 [NC]
RewriteRule ^([^/]*)/key/([^/]*)\.html$ /?site=$1&key=$2 [NC]
RewriteRule ^([^/]*)/([^/]*)/newsID/([^/]*)\.html$ /?site=$1&action=$2&newsID=$3 [NC]
RewriteRule ^([^/]*)/([^/]*)/squadID/([^/]*)\.html$ /?site=$1&action=$2&squadID=$3 [


Moze mi ktos powiedziec czemu wszystkie reuglki dzialaja oprocz tej:

Kod
RewriteRule ^([^/]*)/newsID/([^/]*)\.html$ /?site=$1&newsID=$2 [NC]


Ja nie mam zielonego pojecia.

Ten post edytował deadwheel 25.04.2013, 15:57:18
Go to the top of the page
+Quote Post

Posty w temacie


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: 17.10.2025 - 07:48