Jump to content
php.lv forumi

.htaccess


jannis

Recommended Posts

probza taada -

pashlaik .htaccess fails ir shaads:

 

RewriteEngine on

RewriteCond %{REQUEST_URI} !(.*)gif$ [NC]

RewriteCond %{REQUEST_URI} !index.php [NC]

RewriteRule ^(.*)$ index.php?$1

 

un viss shancee, bet ievajadzeejaas vienai mapei uzlikt, lai tomeer taas gif failus (arii apakshmapeem) nevareetu apskatiit pa taisno (bet caur index.php). kaa to izdariit?

Link to comment
Share on other sites

aaa un ja vajag lai index.php tomeer vari nolasiit, tad ir jaataisa skriptinjsh, kas ielasa attieciigo failu:

 

read.php

// noraadi header, ka taa ir bilde jpg/gif etc.

$_GET['id']; //sanjem id, kuru bildi ielasiisi etc

fopen(); //ver valjaa failu

fread ... //un printee araa

echo ...

 

un tad tajaa index.php veido linku

<img src="http://.../read.php?id=bildes_nosaukums" />

 

nu taada taa ideja.

p.s. ieprieksh mineetais htaccess fails paliek tajaa direktorijaa...

Link to comment
Share on other sites

tu jau to dou nesaprati...

RewriteCond %{REQUEST_URI} !(.*)gif$ [NC]

ir lai, ievadot bildes url, taa uzreiz tiktu atveerta, a

RewriteRule ^(.*)$ index.php?$1

ir lai visus paareejos pieprasiijumus nodotu index failam. nu bet vajag, lai noteiktai mapei tomeer gif failu url arii tiktu nodots index failam (php puse pasham sakidra, bet nu tas .htaccess ...)

Link to comment
Share on other sites

×
×
  • Create New...