Regular expression i htaccess regex, PCRE, POSIX, upotreba Apache .htaccess , mod_rewrite |
|
Alati teme | Način prikaza |
|
28. 05. 2007. | #1 |
A suicide bomber!
Certified
|
problem sa mod_rewrite...
imam sledeci kod u .htaccess-u:
Kôd:
RewriteEngine on RewriteCond $1 !^(index\.php|themes/.+|robots\.txt) [NC] RewriteRule ^(.*)$ index.php?q=$1 [L] e sad, ako zahtevam stranicu npr: http://localhost/gimnazija/vesti/2007/5/1 mod_rewrite ce lepo to da mi redirektuje na http://localhost/gimnazija/index.php?q=vesti/2007/5/1 dok u address baru ostaje http://localhost/gimnazija/vesti/2007/5/1 a ako zahtevam samo pocetnu stranicu, tj: http://localhost/gimnazija ovo dobijam u address baru: http://localhost/gimnazija/?q=F:/Pro...docs/gimnazija prikazuje mi se pocetna strana (jer ne prepoznaje F: kao validnu stranu pa vuce default) ali me nervira ovo sto menja adress bar... kako to da sredim?
__________________
jQuery addict! |
28. 05. 2007. | #2 |
Ivan Dilber
Sir Write-a-Lot
|
probaj da stavis:
RewriteRule ^(.+)$ index.php?q=$1 [L] umesto druge linije (da stavis + umesto * )
__________________
Leadership is the art of getting people to want to do what you know must be done. |
29. 05. 2007. | #3 |
A suicide bomber!
Certified
|
noup, i dalje isto...
jel moze mala pomoc, kako da izmenim condition da mi doda / na kraju ako nema (jer mi je to problem, ako ukucam http://localhost/gimnazija/ onda sve radi ok, ali bez slasha mi menja adresu u adress baru)
__________________
jQuery addict! |
31. 05. 2007. | #4 | |
novi član
Na probnom radu
Datum učlanjenja: 19.10.2006
Poruke: 13
Hvala: 2
0 "Hvala" u 0 poruka
|
Citat:
Kôd:
RewriteRule ^(.*)/?$ index.php?q=$1 [L] |
|
31. 05. 2007. | #5 |
Boban Karišik
Expert
|
hm, ne verujem..
probaj ovo: Kôd:
RewriteRule ^(.+[^/])$ $1/ [R,L]
__________________
Ako već nisi Anđeo, bar budi čovek... |
08. 06. 2007. | #6 |
A suicide bomber!
Certified
|
dodao sam FollowSymLinks opciju i problem je nestao
Kôd:
Options +FollowSymLinks RewriteEngine on RewriteCond $1 !^(index\.php|themes/.+|robots\.txt) [NC] RewriteRule ^(.*)$ index.php?q=$1 [L]
__________________
jQuery addict! |
|
|
Slične teme | ||||
Tema | Početna poruka teme | Forum | Odgovori | Poslednja poruka |
mod_rewrite i problem sa putanjama | Marko Medojevic | Sva početnička pitanja | 6 | 20. 11. 2008. 15:39 |
[mod_rewrite] - Problem sa brojem parametara | mb_sa | Regular expression i htaccess | 4 | 09. 03. 2008. 20:10 |
mod_rewrite | Predrag Gajić | PHP | 3 | 27. 02. 2008. 17:28 |
Htaccess, mod_rewrite problem | nEdImT | Regular expression i htaccess | 5 | 29. 01. 2008. 15:25 |
mod_rewrite problem | McChoban | Regular expression i htaccess | 8 | 26. 08. 2006. 16:13 |