2011-04-09 37 views
1

htaccess文件重定向到我的網頁像的.htaccess圖像顯示問題

網站/ PAGETITLE到index.php?ID = PT

,並顯示出從 類網站/條條/ PAGETITLE

現在.htaccess文件考慮我的圖像文件夾作爲catgory目錄和圖像作爲pageTitle並且不顯示圖像 即使當我指向url時它顯示文章頁面

Options +FollowSymlinks 
RewriteEngine on 


RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 


#show urls like site/author/pageno 

RewriteRule ^author/(.*)/(.*)$ index.php?author=$1&page=$2 [NC] 
RewriteRule ^author/(.*)?$ index.php?author=$1&page=$2 [NC] 

#show articles like site/article/articleTagName 

RewriteRule ^article/(.*)/(.*)?$ index.php?article=$1 [NC] 
RewriteRule ^article/(.*)?$ index.php?article=$1 [NC] 


#direst article site/articleTagName 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ index.php?article=$1 [L,QSA] 



#set image folder and user folder to real from virtual 
RewriteRule ^(.*)/images/$ /images/ 

回答

1

RewriteRule ^(.*)/images/(.*)$ images/$2 

我面臨同樣的問題,更換你的最後一行,但我從你的編碼有一個提示,並改變了代碼一點點;現在它工作正常。

+0

如果我的路徑= www.test.com/img/test/12.jpg 正確的路徑資源/圖像/測試/ 12.JPG 我可以這樣寫? RewriteRule ^(。*)/ img/$ resource/image/$ 1 – Leon 2012-01-16 07:22:09