2011-02-01 55 views
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 ## 

回答

0

不太知道究竟你的意思,但看起来应该是一件容易的事,因为htacces可以很容易rewrite your urlsredirect用户temporary or permanentabove or below water

我所知道的htaccess,我从下面的链接了解到,值得一试!

Guide to Stupid htaccess Tricks Worth Mastering

+0

嗨,山姆,谢谢你看我的问题。当谈到htaccess时,我是完全新手。我会如何编写这段代码? http://www.mydomain.com/userimgs/image.jpg我的userimgs文件夹位于mydomain.com上方 – Jack 2011-02-01 21:37:59

相关问题