Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Rewrite rule problemcic

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
borisko



Joined: 23 Jan 2008
Posts: 3

PostPosted: 27.07.2008 21:58    Post subject: Rewrite rule problemcic Add user to your forum ignore list Reply with quote

Kako da izvedem da navedeni rewrite rule ne vrijedi za npr .css i .jpg fileove?

Code:
RewriteRule  ^test/?$ test.html


Znam da je bilo ovdje već, ali stvarno nemogu pronaći i već se 2h borim sa time...hvala puno.
Back to top
View user's profile Send private message
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 29.07.2008 11:27    Post subject: Add user to your forum ignore list Reply with quote

Ovak napamet, i nabrzaka, dodaj samo još jedan rule prije tog, koji će ponišiti ovaj tvoj:
Code:
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule  \.(css|jpg) - [L]
  RewriteRule  ^test/?$ test.html
</IfModule>


Mada nisam siguran što se želi postići zelis sa ovim '$' na kraju, možda je bolje da je zadnji rule bez tog '$' znaka...

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
borisko



Joined: 23 Jan 2008
Posts: 3

PostPosted: 29.07.2008 14:08    Post subject: Add user to your forum ignore list Reply with quote

Hvala puno, Zyt, ali to sam već pokušavao i ne radi...

Code:

 RewriteEngine On
RewriteRule  \.(css|jpg) - [L]
RewriteRule  ^test/? test.html


Znači kada sam na http://localhost/test/ apache .css i .jpg još uvijek traži u /test/ folderu a ne u rootu tj. http://localhost/

Jesam li ja nešto krivo shvatio, ili?
Back to top
View user's profile Send private message
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 29.07.2008 14:13    Post subject: Add user to your forum ignore list Reply with quote

borisko wrote:
Jesam li ja nešto krivo shvatio, ili?

Pa ovisi što se želi postići.

Ako je .css file linkan sa <link rel="stylesheet" href="style.css" /> onda će ga uvijek tražiti
relativno od trenutnog url-a...

Ako želiš apsolutnu kontrolu, linkaj .css sa "/style.css" i onda ce ga uvijek traziti od root-a,
koji uvijek možeš dodatno "promijeniti" korištenjem <base> html elementa.

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
borisko



Joined: 23 Jan 2008
Posts: 3

PostPosted: 30.07.2008 00:43    Post subject: Add user to your forum ignore list Reply with quote

Uf, onda sam stvarno krivo shvatio.

Znači ako imam rule koji se odnosi na sve ekstenzije, onda ga za neke jednostavno mogu isključiti, ali ako je ovako napisano, nejde.

Hvala puno, sad mi je jasnije. Onda ću sve apsolutno...hvala još jednom.
Back to top
View user's profile Send private message
designCreaTor



Joined: 29 Sep 2005
Posts: 59
Location: Sarajevo, BA

PostPosted: 02.11.2009 22:46    Post subject: Add user to your forum ignore list Reply with quote

ako imam nesta.php?show=nesta-sto-se-prikazuje
i hocu da rewritam na adresa.com/nesta-sto-se-prikazuje.html...

proboa sam sa

rewriteEngine on
rewriteRule ^(.*).html /nesta\.php\?show=$1

ali ne ide...

kako? Shocked
Back to top
View user's profile Send private message MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 02.11.2009 23:58    Post subject: Add user to your forum ignore list Reply with quote

designCreaTor wrote:
ako imam nesta.php?show=nesta-sto-se-prikazuje
i hocu da rewritam na adresa.com/nesta-sto-se-prikazuje.html...

proboa sam sa

rewriteEngine on
rewriteRule ^(.*).html /nesta\.php\?show=$1

ali ne ide...

kako? Shocked


Cini mi se da ti fali '$' znak nakon '.html', kod mene lokalno uredno radi ovo:
Code:
RewriteRule ^(.*).html$ nesto.php?show=$1

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group