[APACHE] rewrite

follettinux

Nuovo Utente
2 Nov 2011
21
0
0
Salve, ho un problema con un htaccess su uno spazio linux aruba
Devo fare il rewrite sul frontend, il quale gira tutto su index.php

Tre voci menu
index.php?link=home
index.php?link=biografia
index.php?link=contattami

li ho trasformati così:
home.html
biografia.html
contattami.html

usando questo rewrite:

Codice:
   RewriteEngine on
    RewriteRule ^([A-Za-z0-9-]+)\.html/?$ index.php?link=$1 [NC,L]

però ho altre pagine:
index.php?link=genere1&name=xxxxx&id=numero1
index.php?link=genere2&name=yyyyyy&id=numero2

che voglio trasformare in
/genere1/xxxxxx.html
/genere2/yyyyyy.html

Ho provato ad inserire


Codice:
   RewriteEngine on
    RewriteRule ([A-Za-z0-9-]+)\.html/?$ index.php?link=$1 [NC,L]
    RewriteRule ([A-Za-z0-9-]+)/([0-9]+)-([A-Za-z0-9-]+)\.html/?$  index.php?link=$1&name=$3&id_ob=$2   [NC,L]

così sembra funzionare ma ci sono dei problemi nel secondo rewrite, non legge le immagini i css e i js. Allora ho inserito


Codice:
   RewriteEngine on
    RewriteCond %{REQUEST_URI} !\.(gif|png|jpg|jpeg|bmp|css|js)$ [NC]
    RewriteRule ([A-Za-z0-9-]+)\.html/?$ index.php?link=$1 [NC,L]
    RewriteRule ([A-Za-z0-9-]+)/([0-9]+)-([A-Za-z0-9-]+)\.html/?$  index.php?link=$1&name=$3&id_ob=$2   [NC,L]

Ricordo che il
Codice:
Options +FollowSymlinks
è commentato perché su aruba si blocca e non so il perché.
 

Discussioni simili