2015-06-29 54 views
1

所以我剛剛開始掌握.htaccess,並且我已經能夠對我的URL進行優化。htaccess禁止我使用完整路徑

# localhost/index.php?side=kunder => localhost/kunder 
RewriteRule ^([^\/\.]+)/?$ index.php?side=$1 [NC,L] 

# localhost/index.php?side=kunde&id=1 => localhost/kunde/1 
RewriteRule ^([^\/]*)?/([^\/]*)?$ index.php?side=$1&id=$2 [NC,L] 

問題現在我似乎是無法瀏覽到我的收藏夾圖標駐留在根/收藏夾圖標/ favicon.ico的

我想這將把如下:的index.php?方= favicons & id = favicon.ico

任何幫助將不勝感激!

回答

0

您可以使用:

# skip all files and directories from rewrite rules below 
RewriteCond %{REQUEST_FILENAME} -d [OR] 
RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule^- [L] 

RewriteRule ^([^/]+)/?$ index.php?side=$1 [QSA,L] 

RewriteRule ^([^/]+)/([^/]+)/?$ index.php?side=$1&id=$2 [QSA,L] 
+1

真的不知道這意味着什麼,但它的作品! #MustBeMagic – AndersD

+0

http://askapache.com是學習這個的不錯資源 – anubhava

+1

TY會研究這個。更多的visuel學習者你。 – AndersD