2012-01-21 124 views
1

我通过脚本将mp3文件上传到我的网站,但是当我尝试下载它们或使用HTML5播放器播放它们时,它们不会运行。htaccess无法打开上传到服务器上的文件

下载文件链接看起来是这样的:

http://test.entreplus.com/content/plugins/post_audio/uploadify-local/uploads/Mac.(Miller)!%20-%20Jerry's%20Record%20Store.mp3 

,当我试图下载它,它重定向我的主网页。

它只发生在现场,虽然在本地主机它工作正常。

有人可以看看我的.htaccess文件,看看问题是否在那里?

Options +Indexes +FollowSymlinks 
RewriteEngine on 

## Redirect www.example.com to example.com. Add ## if you don't need the redirect. 
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] 
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 

AddType application/x-shockwave-flash swf 

# BEGIN EXPIRES 
#cache html and htm files for one day 
<FilesMatch ".(html|htm)$"> 
Header set Cache-Control "max-age=43200" 
</FilesMatch> 

#cache css, javascript and text files for one week 
<FilesMatch ".(js|css|txt)$"> 
Header set Cache-Control "max-age=604800" 
</FilesMatch> 

#cache flash and images for one month 
<FilesMatch ".(flv|swf|ico|gif|jpg|jpeg|png)$"> 
Header set Cache-Control "max-age=2592000" 
</FilesMatch> 

#disable cache for script files 
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$"> 
Header unset Cache-Control 
</FilesMatch> 
# END EXPIRES 

<IfModule mod_gzip.c> 
    mod_gzip_on Yes 
    mod_gzip_dechunk Yes 
    mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ 
    mod_gzip_item_include handler ^cgi-script$ 
    mod_gzip_item_include mime ^text\.* 
    mod_gzip_item_include mime ^application/x-javascript.* 
    mod_gzip_item_exclude mime ^image\.* 
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* 
</IfModule> 

##### CORE ADMIN ##### 
RewriteRule ^admin/?$ admin_index.php [L] 
RewriteRule ^admin/([a-zA-Z0-9_-]+)/?$ admin_index.php?page=$1 [L] 
RewriteRule ^admin/plugin_settings/plugin/([a-zA-Z0-9_-]+)/?$ admin_index.php?page=plugin_settings&plugin=$1 [L] 

##### GENERIC RULES ##### 
RewriteRule \.(css|php|png|jpg|gif|ico|js|inc|txt|gz|xml|html)$ - [NC,L] 
RewriteRule ^([^/]*)/?$ index.php?page=$1 [L] 
RewriteRule ^([^/]*)/([^/]*)/?$ index.php?$1=$2 [L] 
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/?$ index.php?page=$1&$2=$3 [L] 
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ index.php?$1=$2&$3=$4 [L] 
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ index.php?page=$1&$2=$3&$4=$5 [L] 
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ index.php?$1=$2&$3=$4&$5=$6 [L] 
+2

尝试从正在处理即加'mp3'此为重写规则''排除文件.mp3' \。(mp3 | css | php | png | jpg | gif | ico | js | inc | txt | gz | xml | html)$ - [NC,L]' –

+0

谢谢!这工作! – Manolis

回答

0

答案,如Ulrich Palha写道,是

排除.MP3被处理,即把它添加MP3为
重写规则文件(MP3 |。CSS | PHP | PNG | JPG | GIF | ICO | JS |股份有限公司| TXT |广州| XML | HTML)$ - [NC,L]

相关问题