Robis Posted February 28, 2005 Report Share Posted February 28, 2005 Sveiki! Zinu, ka šis ir aprunāts temats, bet tomēr, neesmu ar to nodarbojies, bet man vajag konkrēti šādu uzdevumu: url /index.php?lang=lv&page=blabla&subpage=blablabla pārveidot uz: /lv/blabla/blablabla/index.html ar mod rewrite palīdzību! Protams, ir pieļaujams, ka netiek padots neviens parametrs utt. Vai kāds lūdzu var dot ātru risinājumu tieši šim gadījumam? Link to comment Share on other sites More sharing options...
Robis Posted February 28, 2005 Author Report Share Posted February 28, 2005 Uztaisiju šitādu .htaccess : RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-F RewriteCond %{REQUEST_FILENAME} !-D RewriteRule ^.htaccess$ - [F] RewriteRule (.*) index.php [L] RewriteRule ^/(.*)/index.html /index.php?lang=$1 RewriteRule ^/(.*)/(.*)/index.html /index.php?lang=$1&page=$2 RewriteRule ^/(.*)/(.*)/(.*)/index.html /index.php?lang=$1&page=$2&subpage=$3 php_flag register_globals 0 It kā pareizo lapu atvēra, tikai viss saits sāka tā bremzēt un neielādēja ne bildes, ne stilus. :( Link to comment Share on other sites More sharing options...
Robis Posted February 28, 2005 Author Report Share Posted February 28, 2005 Izrādās, visām bildēm utt. tiek iedots ceļš http://www.domain.lv/lv/blabla/blablabla/bildes/bilde.jpg , kas nav pareizi, jo jābūt: http://www.domain.lv/bildes/bilde.jpg Ko darīt? Vai to var koriģēt pie rewrite? Link to comment Share on other sites More sharing options...
Venom Posted February 28, 2005 Report Share Posted February 28, 2005 tev iekš ^/(.*)/index.html (.*) nostrādā līdz pašām URL beigām, try this: ^/(.*)/index.html$ Link to comment Share on other sites More sharing options...
Robis Posted February 28, 2005 Author Report Share Posted February 28, 2005 Izdarīju, tik un tā viņš bilžu ceļus meklē ne tur. Link to comment Share on other sites More sharing options...
Klez Posted February 28, 2005 Report Share Posted February 28, 2005 kaads varbuut var pateikt kaada atshkiriiba, ja lieto ?pad=1&si=4&pid=9 vai /1/4/9/ ?? Link to comment Share on other sites More sharing options...
PheliX Posted February 28, 2005 Report Share Posted February 28, 2005 droshi vien noraadi relatiivo celju bildeem un browsers kabina linkam galaa. liec priekshaa / un noraadi pilnu celju liidz bildei Link to comment Share on other sites More sharing options...
PheliX Posted February 28, 2005 Report Share Posted February 28, 2005 Klez - tieshi taada arii ir atshkjiriiba. mainaas tikai tas ko redz adreses joslaa :) Link to comment Share on other sites More sharing options...
Robis Posted February 28, 2005 Author Report Share Posted February 28, 2005 saliku pilnus celjus! Tik un tā! neko nerāda! Link to comment Share on other sites More sharing options...
Robis Posted February 28, 2005 Author Report Share Posted February 28, 2005 ATKLĀTI SAKOT, TAS URL REWRITE VISPĀR NESTRĀDĀ, JO NERĀDA NEVIENU BILDI UN NOSPIEŽOT UZ KĀDA CITA LINKA, VIŅŠ NEAIZIET UZ TO VAJADZĪGO LAPU! Vai kāds var palīdzēt??? Link to comment Share on other sites More sharing options...
Roze Posted February 28, 2005 Report Share Posted February 28, 2005 Vispār jau der pielikt RewriteCond %{REQUEST_URI} !\.(css|js|jpg|gif|jpeg) t.i. bildēm u.c. figņām rewrite ruli neizmantot. taču attiecigi bildes vairs nevar likt relatīvi proti src="img/bla.jpg" vietā jāliek src="/img/bla.jpg" kur attiecīgi /img/ ir direktorijas attiecībā pret webrootu. Link to comment Share on other sites More sharing options...
Robis Posted February 28, 2005 Author Report Share Posted February 28, 2005 Ok, nu .htaccess izskatas tads: RewriteEngine on #Options +FollowSymLinks RewriteBase / RewriteCond %{REQUEST_FILENAME} !-F RewriteCond %{REQUEST_URI} !\.(css|js|jpg|gif|jpeg) RewriteRule ^.htaccess$ - [F] RewriteRule (.*) index.php [L] RewriteRule ^/(.*)/index.html$ /index.php?lang=$1 [L] RewriteRule ^/(.*)/$ /index.php?lang=$1 [L] RewriteRule ^/(.*)$ /index.php?lang=$1 [L] RewriteRule ^/(.*)/(.*)/index.html$ /index.php?lang=$1&page=$2 [L] RewriteRule ^/(.*)/(.*)/(.*)/index.html$ /index.php?lang=$1&page=$2&subpage=$3 [L] php_flag register_globals 0 Tik un ta apaksha tik rada: Web site found! Waiting for reply... - tas ta ka uzkaries Nez, bet bildes tapat, nekas nekachajas ieksha! Varbut man kaut kas php koda jaliek? Es nezinu, pirmo reizi taisu friendly url, bet man vinju vajag obligati! Link to comment Share on other sites More sharing options...
рпр Posted February 28, 2005 Report Share Posted February 28, 2005 ATKLĀTI SAKOT, TAS URL REWRITE VISPĀR NESTRĀDĀ, JO NERĀDA NEVIENU BILDI UN NOSPIEŽOT UZ KĀDA CITA LINKA, VIŅŠ NEAIZIET UZ TO VAJADZĪGO LAPU! Vai kāds var palīdzēt??? 14350[/snapback] mod_rewrite ir savs logfails. skaties logfailā, kas pa kļūdu. Link to comment Share on other sites More sharing options...
Robis Posted February 28, 2005 Author Report Share Posted February 28, 2005 VAI KĀDS VAR LŪDZU PALĪDZĒT? LŪK UZTAISĪJU .htaccess : #Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !\.(css|js|jpg|gif|jpeg) RewriteRule ^.htaccess$ - [F] RewriteRule (.*) index.php RewriteRule ^/(.*)/index.html$ /index.php?lang=$1 RewriteRule ^/(.*)/$ /index.php?lang=$1 RewriteRule ^/(.*)$ /index.php?lang=$1 RewriteRule ^/(.*)/(.*)/$ /index.php?lang=$1&page=$2 RewriteRule ^/(.*)/(.*)$ /index.php?lang=$1&page=$2 RewriteRule ^/(.*)/(.*)/index.html$ /index.php?lang=$1&page=$2 RewriteRule ^/(.*)/(.*)/(.*)/index.html$ /index.php?lang=$1&page=$2&subpage=$3 RewriteRule ^/(.*)/(.*)/(.*)/$ /index.php?lang=$1&page=$2&subpage=$3 RewriteRule ^/(.*)/(.*)/(.*)$ /index.php?lang=$1&page=$2&subpage=$3 [L] php_flag register_globals 0 Bet kad mēģinu vērt kaut ko vaļā, browseris uzkaras, tas ir, visu laiku "web site found. waiting for reply..." "done" un visu laiku tas atkartojas un nekas neparādās!!! Link to comment Share on other sites More sharing options...
Roze Posted February 28, 2005 Report Share Posted February 28, 2005 Man ir aizdomas vai nu ir kaut kāds rewrite erors vai arī iestājas loops (t.i. webserveris redirectē pats uz sevi) Es tavā vietā iesākumā ieliktu šādu ruli: RewriteEngine On RewriteCond %{REQUEST_URI} !\.(css|js|jpg|gif|jpeg) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?dir=$1 [QSA,L] Un tad attiecīgi 'dir' mainīgo explodēt pa '/' un sadalīt pa mainīgajiem ($lang, $page, $subpage) un veikt analīzi jau php galā. Link to comment Share on other sites More sharing options...
Recommended Posts