anonīms Posted October 30, 2008 Report Share Posted October 30, 2008 (edited) RewriteRule ^([a-zA-Z_]+)/([0-9]+)/?$ index.php?page=$1&id=$2 [QSA,L] ejot caur www.manalapa.lv/?page=user&id=1 viss iet. ejot caur www.manalapa.lv/user/1 arī viss iet, bet man vajag www.manalapa.lv/user/1/ mēģināju flagu arī bez L, bet efekts - nekāds. kur varētu būt problēma? Piev: palabojot RewriteRule ^([a-zA-Z_]+)/([0-9]+)/ index.php?page=$1&id=$2 [QSA] uz RewriteRule ^([a-zA-Z_]+)/([0-9]+)/?a$ index.php?page=$1&id=$2 [QSA] un ejot www.manalapa.lv/user/1/a viss iet. Edited October 30, 2008 by anonīms Link to comment Share on other sites More sharing options...
andrisp Posted October 30, 2008 Report Share Posted October 30, 2008 Pag, problēma ir, ka ar / beigās neiet ? PS. "mēģināju flagu arī bez L, bet efekts - nekāds." - L nav sakara pašu regexpu. Link to comment Share on other sites More sharing options...
anonīms Posted October 30, 2008 Author Report Share Posted October 30, 2008 Jā problēma ir tur, ka ar / neiet beigās. Link to comment Share on other sites More sharing options...
andrisp Posted October 30, 2008 Report Share Posted October 30, 2008 Man liekas, ka problēma tad visticamāk ir citur, nevis pašā regexpā. Tikko izmēģināju un man viss iet. Link to comment Share on other sites More sharing options...
anonīms Posted October 30, 2008 Author Report Share Posted October 30, 2008 a kā tu rakstiji? Link to comment Share on other sites More sharing options...
andrisp Posted October 30, 2008 Report Share Posted October 30, 2008 Nu es tieši tā arī rakstīju kā tu: RewriteEngine On RewriteRule ^([a-zA-Z_]+)/([0-9]+)/?$ index.php?page=$1&id=$2 [QSA,L] Link to comment Share on other sites More sharing options...
anonīms Posted October 30, 2008 Author Report Share Posted October 30, 2008 em, laika aizmirsu pieminēt, ka no tā tas id kalpo kā datu izvilcējus FROM table WHERE id = {$_GET['id']} un user/1 izvelk user/1/ neizvelk Link to comment Share on other sites More sharing options...
andrisp Posted October 30, 2008 Report Share Posted October 30, 2008 Pag, tad sanāk, ka reāli pieprasījums tiek pārrakstīts uz index.php?page=$1&id=$2 ? Tas ir - index.php tiek atvērts ? Link to comment Share on other sites More sharing options...
anonīms Posted October 30, 2008 Author Report Share Posted October 30, 2008 jā index.php?page=users&id=1 Link to comment Share on other sites More sharing options...
andrisp Posted October 30, 2008 Report Share Posted October 30, 2008 Ieliec index.php sākumā: print_r($_GET); Un paskaties, ko izdurkā bez / un ar /. Link to comment Share on other sites More sharing options...
anonīms Posted October 30, 2008 Author Report Share Posted October 30, 2008 bez / - Array ( => user [id] => 1 ) ar / - Array ( => user/1 ) Link to comment Share on other sites More sharing options...
andrisp Posted October 30, 2008 Report Share Posted October 30, 2008 Un tas regexps točna ir tāds kādu tu mums te rādi ? Link to comment Share on other sites More sharing options...
anonīms Posted October 30, 2008 Author Report Share Posted October 30, 2008 nu jā. RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ index.php?page=$1 [QSA] RewriteRule ^lang/(.*)$ index.php?lang=$1 [QSA,L] RewriteRule ^([a-zA-Z_]+)/([0-9]+)/$ index.php?page=$1&id=$2 [QSA,L] viss dokuments Link to comment Share on other sites More sharing options...
andrisp Posted October 30, 2008 Report Share Posted October 30, 2008 RewriteRule ^(.*)/$ index.php?page=$1 [QSA] Un kā tu domā, kas ir šis ? :) Link to comment Share on other sites More sharing options...
anonīms Posted October 30, 2008 Author Report Share Posted October 30, 2008 (edited) Bija aizdomas, ka viņš varētu būt pie vainas, jo atrodas pirms tā.. Nu, bet kā labot? ok, /1/ iet tagad RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^lang/(.*)$ index.php?lang=$1 [QSA,L] RewriteRule ^([a-zA-Z_]+)/([0-9]+)/$ index.php?page=$1&id=$2 [QSA,L] RewriteRule ^mail/(.*)?$ index.php?page=mail&do=$1 [QSA,L] Bet tagad neiet ja eju www.manalapa.lv/users/ Edited October 30, 2008 by anonīms Link to comment Share on other sites More sharing options...
Recommended Posts