Cibiņš Posted January 23, 2013 Report Share Posted January 23, 2013 Nevaru tagad saprast vienu lietu. Ja to htaccess nelieto, tad adreses veidojas šādas ?pg=lapa vai?lang=valoda vai?lang=valoda&pg=lapa...utt (arī kategorijas) Ja liekam HTACCESSu ar adrešu pārrakstīšanas norādēm tad vajadzētu veidoties /lapa/ vai/valoda/ vai/valoda/lapa/...utt (arī kategorijas) Bet strādā tikai viens nosacījums, citi neklausa. Kods kas veido ?pg=... if($pg){ if(file_exists("resources/pages/".$pg.".php")){ include("resources/pages/".$pg.".php"); } else{ include("resources/pages/notfound.php"); } } else { include("resources/pages/home.php"); } HTACCESSa saturs RewriteEngine On RewriteRule ^([^/]*)/$ /?lang=$1 [NC,OR] RewriteRule ^([^/]*)/$ /?cat=$1 [NC,OR] RewriteRule ^([^/]*)/$ /?pg=$1 [NC,OR] RewriteRule ^([^/]*)/([^/]*)/$ /?lang=$1&pg=$2 [NC,OR] RewriteRule ^([^/]*)/([^/]*)/$ /?cat=$1&pg=$2 [NC,OR] RewriteRule ^([^/]*)/([^/]*)/$ /?lang=$1&cat=$2 [NC,OR] RewriteRule ^([^/]*)/([^/]*)/$ /?lang=$1&cat=$2&pg=$3 [NC] Pašlaik met ārā Internal Server Error Link to comment Share on other sites More sharing options...
Cibiņš Posted January 23, 2013 Author Report Share Posted January 23, 2013 Kaut ko citu arī māki vai tikai bildītes likt? Link to comment Share on other sites More sharing options...
F3llony Posted January 23, 2013 Report Share Posted January 23, 2013 Cibiņ, vērsies pie manuāļa... Līdz kaut kam šādam vienkārši vajag prast dadomāties.... Link to comment Share on other sites More sharing options...
Cibiņš Posted January 23, 2013 Author Report Share Posted January 23, 2013 :D :D :D kāda jēga no foruma ja te atbilde ir viena - "padomā pats", "palasi pats" utt :D :D :D neredzu jēgu no šī foruma. :D var wnk teikt ka latviešiem forumus nevajag, visur visi tiek nodirsti utt ;) Link to comment Share on other sites More sharing options...
daGrevis Posted January 23, 2013 Report Share Posted January 23, 2013 Pieci lati un saldējums. Link to comment Share on other sites More sharing options...
F3llony Posted January 23, 2013 Report Share Posted January 23, 2013 daGrevii, nu pat es nedomāju, ka Tu esi TIK lēts... Cmoon Link to comment Share on other sites More sharing options...
daGrevis Posted January 23, 2013 Report Share Posted January 23, 2013 Haha! Link to comment Share on other sites More sharing options...
Pats Toms Posted January 23, 2013 Report Share Posted January 23, 2013 mod_rewrite dokumentācija, iespējams, arī kāds regex referencs, uzgūglē php url routing, nezinu, ko vēl ieteikt... varbūt beidz ticēt Dievam un sāc programmēt. viss, miers. Link to comment Share on other sites More sharing options...
marrtins Posted January 24, 2013 Report Share Posted January 24, 2013 Tev nostrādās tikai pirmie no rullēm RewriteRule ^([^/]*)/$ /?lang=$1 [NC,OR] un RewriteRule ^([^/]*)/([^/]*)/$ /?lang=$1&pg=$2 [NC,OR] Pārējie taču ir identiski. Link to comment Share on other sites More sharing options...
Cibiņš Posted January 25, 2013 Author Report Share Posted January 25, 2013 Nice1 - To the fuckening => Jau tiku ar šo skaidrībā ;) Link to comment Share on other sites More sharing options...
Recommended Posts