0
我希望有人能幫助我解決這個問題。 我試圖從我的網站根目錄上的一個文件夾在我的網站上顯示圖像,但目前爲止沒有成功。圖像上傳到文件夾,但沒有顯示在網站上。如何編輯.htaccess以在Web根目錄上顯示圖像?
形象 /的public_html/adpics
和我的根目錄
/public_html/mydomain.com
我在/public_html/mydomain.com .htaccess文件和/的public_html/adpics
如何編輯.htaccess文件以將路徑重定向到圖像文件夾?
謝謝您,傑克
RewriteEngine On
# Show ad
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)?/([0-9]+)([-_][^/]*)?/([0-9]+)([-_][^/]*)?\.html /index.php?view=showad&adid=$7&cityid=$1 [QSA]
# Ads
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)?/([0-9]+)([-_][^/]*)?/page([0-9]*)\.html /index.php?view=ads&catid=$3&subcatid=$5&cityid=$1&page=$7 [QSA]
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)?/([0-9]+)([-_][^/]*)? /index.php?view=ads&catid=$3&subcatid=$5&cityid=$1 [QSA]
## Begin Version 5.2 - Pagination bug fix + Uniform page links ##
# Ads by cat
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)?/page([0-9]*)\.html /index.php?view=ads&catid=$3&subcatid=0&&cityid=$1&page=$5 [L,QSA]
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)? /index.php?view=ads&catid=$3&cityid=$1 [QSA]
## End Version 5.2 - Pagination bug fix + Uniform page links ##
# Show event
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/events(/(([0-9]+)-([0-9]+)-([0-9]+)))?/([0-9]+)([-_][^/]*)?\.html /index.php?view=showevent&date=$4&adid=$8&cityid=$1 [QSA]
# Events on date
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/events/(([0-9]+)-([0-9]+)-([0-9]+))/page([0-9]*)\.html /index.php?view=events&date=$3&cityid=$1&page=$7 [QSA]
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/events/(([0-9]+)-([0-9]+)-([0-9]+)) /index.php?view=events&date=$3&cityid=$1 [QSA]
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/events /index.php?view=events&cityid=$1 [QSA]
# Show image
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/images/([^/]+)/([0-9]+)([-_][^/]*)?\.html /index.php?view=showimg&posterenc=$3&imgid=$4&cityid=$1 [QSA]
# Images by user, paged
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/images/([^/]+)/page([0-9]+)\.html /index.php?view=imgs&posterenc=$3&cityid=$1&page=$4 [QSA]
# Top Images, paged
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/images/page([0-9]+)\.html /index.php?view=imgs&cityid=$1&page=$3 [QSA]
# Images by user
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/images/([^/]+) /index.php?view=imgs&posterenc=$3&cityid=$1 [QSA]
# Top Images
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/images /index.php?view=imgs&cityid=$1 [QSA]
# Quick ad/event/image
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/showpost/([0-9]+)([-_][^/]*)?\.html /index.php?view=showad&adid=$3&cityid=$1 [QSA]
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/showevent/([0-9]+)([-_][^/]*)?\.html /index.php?view=showevent&adid=$3&cityid=$1 [QSA]
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/showimage/([0-9]+)([-_][^/]*)?\.html /index.php?view=showimg&imgid=$3&cityid=$1 [QSA]
# City/Region
RewriteRule ^([-]?[0-9]+)([-_][^/]*)? /index.php?view=main&cityid=$1 [QSA]
RewriteRule ^([-]?[0-9]+)([-_][^/]*)? /index.php?view=main&cityid=$1 [QSA]
## Begin Version 5.0 ##
# RSS URLs
RewriteRule ^feed/posts /rss.php?view=ads&cityid=0 [QSA]
RewriteRule ^feed/events /rss.php?view=events&cityid=0 [QSA]
RewriteRule ^feed/([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)?/([0-9]+)([-_][^/]*)? /rss.php?view=ads&catid=$3&subcatid=$5&cityid=$1 [QSA]
RewriteRule ^feed/([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)? /rss.php?view=ads&catid=$3&cityid=$1 [QSA]
RewriteRule ^feed/([-]?[0-9]+)([-_][^/]*)?/posts /rss.php?view=ads&cityid=$1 [QSA]
RewriteRule ^feed/([-]?[0-9]+)([-_][^/]*)?/events/(([0-9]+)-([0-9]+)-([0-9]+)) /rss.php?view=events&date=$3&cityid=$1 [QSA]
RewriteRule ^feed/([-]?[0-9]+)([-_][^/]*)?/events /rss.php?view=events&cityid=$1 [QSA]
## End Version 5.0 ##
嗨,山姆,謝謝你看我的問題。當談到htaccess時,我是完全新手。我會如何編寫這段代碼? http://www.mydomain.com/userimgs/image.jpg我的userimgs文件夾位於mydomain.com上方 – Jack 2011-02-01 21:37:59