2014-10-29 127 views
-1

我有一個url重寫的問題,我不得不排除某些文件爲css,image和其他的目錄。 Howewer我必須.htacces url rewrite排除某些目錄

RewriteEngine敘述在

RewriteCond %{REQUEST_URI} !configurazione/ [OR] 
RewriteCond %{REQUEST_URI} !funzioni/ [OR] 
RewriteCond %{REQUEST_URI} !img/ [OR] 
RewriteCond %{REQUEST_URI} !imgprodotti/ [OR] 
RewriteCond %{REQUEST_URI} !imgslider/ [OR] 
RewriteCond %{REQUEST_URI} !js/ [OR] 
RewriteCond %{REQUEST_URI} !palma/ [OR] 
RewriteCond %{REQUEST_URI} !sezioni/ 

RewriteRule ^([a-z]+)/([a-z]+)/([a-z]+).html$ index.php?pag=$1&prodotti=$2&prodotto=$3 [L] 
RewriteRule ^([a-z]+)/([a-z]+)/ index.php?pag=$1&prodotti=$2 [L] 
RewriteRule ^([a-z]+)/ index.php?pag=$1 [L] 
+0

歡迎來到StackOverflow!你可以說得更詳細點嗎?目前還不清楚問題是什麼,或者你需要什麼幫助。 – Denise 2014-10-29 20:28:12

回答

0

RewriteCond只適用於第二天RewriteRule。請使用THE_REQUEST來代替該代碼:

RewriteCond %{THE_REQUEST} /(funzioni|img|imgprodotti|js|palma|sezioni|configurazione)/ 
RewriteRule^- [L] 

RewriteRule ^([a-z]+)/([a-z]+)/([a-z]+).html$ index.php?pag=$1&prodotti=$2&prodotto=$3 [L,QSA] 
RewriteRule ^([a-z]+)/([a-z]+)/ index.php?pag=$1&prodotti=$2 [L,QSA] 
RewriteRule ^([a-z]+)/ index.php?pag=$1 [L,QSA]