Vebers Posted October 11, 2007 Report Share Posted October 11, 2007 Nezinu vai īsti tevi sapratu, bet šis der? url.rewrite = (".*\.(js|ico|gif|jpg|png|css)$" => "$0", "^path/(.*)$" => "/path/index.php?kat=$1" ) Paskaties regular epressions! -> http://www.google.lv/search?q=regular+expr...lient=firefox-a Link to comment Share on other sites More sharing options...
eregi Posted October 11, 2007 Author Report Share Posted October 11, 2007 pareizi, pareizi saprati :) Liels paldies. BĒT :D ejot http://myip/path/kategorija jaunā kategorija netiek sagremota - attēlota.. pārāda 404. tā leimīgi sanāk. Link to comment Share on other sites More sharing options...
Vebers Posted October 11, 2007 Report Share Posted October 11, 2007 Paeksperimentē ar šo daļu : "^path/(.*)$" , piemēram "^/path/(.*)$", vai "^/path(.*)$", "^path(.*)$" Link to comment Share on other sites More sharing options...
eregi Posted October 11, 2007 Author Report Share Posted October 11, 2007 (edited) I D E Ā L I! Liels paldies visiem, kuri palīdzēja! :) cjort, pēdējais, ja vajag piem padot 2 $_GET piem ?kat=kategorija&id=12 Kā panākt, lai pado to Id. edit: ā un jā, ja jau es eju tālāk, piem http://myip/path/kategorija/huinasvisadas tad man itkā atver main lapu, bet no tās adreses, kā rezūltatā bildes neparādās, jo vairs neatbilst adrse uz bilid. Edited October 11, 2007 by eregi Link to comment Share on other sites More sharing options...
Kristabs Posted October 12, 2007 Report Share Posted October 12, 2007 Visur jānorāda absolūtās adreses. <?php define(DOC_URL,"http://www.myip.com/"); ?> <img src="<?= DOC_URL; ?>imgs/bilde.gif" alt="" /> Link to comment Share on other sites More sharing options...
xPtv45z Posted October 12, 2007 Report Share Posted October 12, 2007 Var jau arī attiecībā pret DocumentRoot direktoriju. <img src="/imgs/bilde.gif" alt="" /> Link to comment Share on other sites More sharing options...
Kristabs Posted October 12, 2007 Report Share Posted October 12, 2007 Mans risinājums ir portablāks. Var izmantot arī subdirektorijas, piemēram, izstrādes laikā uzlikt zem example.com/new/ Link to comment Share on other sites More sharing options...
eregi Posted October 12, 2007 Author Report Share Posted October 12, 2007 Un kāds būtu MakaTaNaw ieteikums? Faktiski ir tā, lai var padot 2 vai vairāk $_GEt'us, jo jāpadod taču sadaļa un Id's, + atkal ja dodās uz http://myip/path/kategorija/kakaashcxndsda...ujejjjddddzakma tad lapa nogļuko, nevis turpina normāli strādāt Link to comment Share on other sites More sharing options...
Vebers Posted October 13, 2007 Report Share Posted October 13, 2007 Tev ir tad mod_rewrite ieslēgts un kā jau tajā reg-epā redzams, ka tiek padots viss url. Paskaties ko saka var_dump($_GET); ja url ir blabla.com/path/kategorija/934, tad $exp = explode('/', $_GET); $kategorija = $exp[0]; $id = $exp[1]; Tas tā, ja pareizi sapratu ko vēlies panākt. Kristabs variants ir portablāks, gan kādreiz noderēs ;) Kādā konfig failā definē pilno URL un viss... Link to comment Share on other sites More sharing options...
Recommended Posts