我有一个上传的表单。上传后我将文件保存到远程站点设置中的/ public_html / images / resumes /(这里是上传的文件)下的文件夹中。这里我将上传文件的名称保存到变量$ filename中。同时我发送邮件使用YII扩展,在邮件中我已经包含了一个链接,可以在浏览器中打开文件名,以便管理员查看这样的
<a href="http://www.hell.com/images/resumes/'.$fileName.'">Resume</a>'
当我打开它时,显示出500内部错误 我发现这是与.htaccess相关的一些权限问题。我添加了以下代码以授予恢复文件夹的权限。
这是我的代码:
#allowing access to resumes folder
<Directory /images/resumes/>
Options +Indexes
它不起作用。我已将文件夹名称更改为/ public_html / images / resume /,它似乎也无法正常工作
这是我的.htaccess可以在那里找到任何一个问题吗?
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
Options -Indexes
#allowing access to resumes folder
<Directory /images/resumes/>
Options +Indexes
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/javascript
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 100 years"
# My favicon
ExpiresByType image/x-icon "access plus 100 years"
# Images
ExpiresByType image/gif "access plus 100 years"
ExpiresByType image/png "access plus 100 years"
ExpiresByType image/jpg "access plus 100 years"
ExpiresByType image/jpeg "access plus 100 years"
# CSS
ExpiresByType text/css "access 100 years"
# Javascript
ExpiresByType application/javascript "access plus 100 years"
#disallows libwww-perl user-agents from accessing your site
RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)=http [NC]
RewriteRule ^(.*)$ – [F,L]
#canonical urls
RewriteCond %{HTTP_HOST} !^www.hell.com [NC]
RewriteRule ^(.*)$ http://www.hell.com/$1 [L,R=301]
#canonical ips
RewriteCond %{HTTP_HOST} ^268\.61\.322\.654
#RewriteRule (.*) http://www.hell.com/$1 [R=301,L]
# disable the server signature
ServerSignature Off