eregi Posted October 11, 2007 Report Posted October 11, 2007 Nu vēlējos 'sekot modei' un izmantot rewrite metodi *lietoju lighttpd. Ieteica man vienkāršu metodi, kura itkā uz apache gāja, vienkārši iemest iekš .htaccess RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*)$ index.php?lapa=$1 [QSA,L] Nu, mēģināju tā, bet neiet, itkā lighttpd.conf palaidu mod_rewrite, vienalga neiet, sāku googlēt un uzroku atbildi - šī metode neder lighttpd. Itkā meklēju kādu labu risinājumu, bet visur tie piemēri tādi gaļimi. Tad, vai kāds, kuram ir bijusi saskarsme ar šo problēmu/lighttpd, varētu palīdzēt? Galvenā doma, lai man nebūt kaut kāds skripts php failos jāraksta, bet gan uzreiz lighttpd configā ( bez joomla)
Delfins Posted October 11, 2007 Report Posted October 11, 2007 eu, bez PHP modificēšanas tev tur nekas nesanāks uzreiz pa taisno... aizmirsti. Ja grib rewrite, tad arī PHP dzinis tam ir jāpielāgo.
Vebers Posted October 11, 2007 Report Posted October 11, 2007 http://www.xyooj.com/blog/plink/technical/...ith-examples/1/
Vebers Posted October 11, 2007 Report Posted October 11, 2007 (edited) Kas tieši no tā visa tev šķiet neskaidrs? url.rewrite = ( "^(.*)/file.html(.*)" => "/$1/file.php$2" ) Reg-expi tādi paši kā jau vienmēr. p.s.: šajā piemērā ir pārrakstīts kā pārrakstīt file.html uz file.php, ja nu kas... Edited October 11, 2007 by MakaTaNaw
eregi Posted October 11, 2007 Author Report Posted October 11, 2007 Derēs! itkā sapratu url.rewrite = ( "^(.*)/php(.*)" => "/$1/index.php?kat=php$2" ) Bet kā panākt, lai man nebūtu katrai saitei savs jātaisa? piem url.rewrite = ( "^(.*)/addr(.*)" => "/$1/index.php?kat=addr$2" ) url.rewrite = ( "^(.*)/addr2(.*)" => "/$1/index.php?kat=addr2$2" ) bet gan, lai automātiski viss notiek, piem ja tiek padots /muša tad uzreiz index.php?kat=muša, ja /998818bcsaxzxu8w883jkkmxmmxiaixvvvvvv tad index.php?kat=998818bcsaxzxu8w883jkkmxmmxiaixvvvvvv
Vebers Posted October 11, 2007 Report Posted October 11, 2007 Damn... nu! Pats pirmajā postā to jau biji ierakstījis url.rewrite = ( "^(.*)$" => "index.php?lapa=$1" )
eregi Posted October 11, 2007 Author Report Posted October 11, 2007 Der, bēt problēma, ka man tā lapa stāv vēl vienā path'ā, piem. htdocs/path mēģinu url.rewrite = ( "^(.*)$" => "/path/index.php?kat=$1&$2" ) bet ejot uz http://myip.com/kategorija nekas netiek padots tālāk, tikai parasts index.php saturs, vēlpietam, neinklūdojot css..
marcis Posted October 11, 2007 Report Posted October 11, 2007 (edited) url.rewrite = ( "^(.*)$" => "path/index.php?kat=$1" ) un index htmls arī attiecīgi jānoformē ( /path/style.css - ja pieņem ka stails glabājas tajā pašā mapē kur index ) Edited October 11, 2007 by marcis
Vebers Posted October 11, 2007 Report Posted October 11, 2007 No kurienes tu izrauj url.rewrite = ( "^(.*)$" => "/path/index.php?kat=$1&$2" ) , ja iekš reg-exp ir tikai viens mainigais (šajā gadījumā) ?
eregi Posted October 11, 2007 Author Report Posted October 11, 2007 nesanāk, mēginu atvērt arī caur browzeri to css failu - http://myip/path/includes/stils.css atver vnk indexu iekš path.
Vebers Posted October 11, 2007 Report Posted October 11, 2007 (edited) url.rewrite = (".*\.(js|ico|gif|jpg|png|css)$" => "$0", "^(.*)$" => "/path/index.php?kat=$1" )") vajadzētu palīdzēt... Edited October 11, 2007 by MakaTaNaw
eregi Posted October 11, 2007 Author Report Posted October 11, 2007 url.rewrite = (".*\.(js|ico|gif|jpg|png|css)$" => "$0", "^(.*)$" => "/path/index.php?kat=$1" )") vajadzētu palīdzēt... Lighttpd, nepaņem pretī - nestartējās. ~ # /etc/init.d/lighttpd restart 2007-10-11 22:22:44: (configfile.c.768) source: /etc/lighttpd/lighttpd.conf line : 228 pos: 152 invalid character in variable name 2007-10-11 22:22:44: (configfile.c.824) configfile parser failed at: ) # mod_redirect # see redirect.txt # # url.redirect = ( # U tā 228 rinda ir tā, kuru iedevi.
Vebers Posted October 11, 2007 Report Posted October 11, 2007 Mazliet aizrāvos ar iekavām : url.rewrite = (".*\.(js|ico|gif|jpg|png|css)$" => "$0", "^(.*)$" => "/path/index.php?kat=$1" )
eregi Posted October 11, 2007 Author Report Posted October 11, 2007 gandrīz ideāli :) Bet man vajadzētu, lai tajā path pašlaik varētu nokļut ievadot browrī path'u piem, http://myip/path/kategorija
Recommended Posts