English 中文(简体)
.htaccessed 500个内部服务器错误
原标题:.htaccess 500 internal server error when set ExpiresActive
  • 时间:2011-07-01 16:29:11
  •  标签:
  • .htaccess

在我的<代码>上,htaccess 我有这一法典:

<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|txt|html|x-html|php|css|xml|js|woff|ttf|svg|eot)(.gz)?$">
ExpiresActive On
Header set Expires "Sun, 27 May 2012 00:00:00 GMT"
Header unset ETag
FileETag None
</FilesMatch>

It seems to work perfectly on some servers, but not on one of my websites. I get a 500 Internal Server Error. Is there anything wrong in the config, or do I have to contact my host?

最佳回答

Ensure that you have these Apache modules enabled and loaded:

  • ExpiresActive -- mod_expires
  • Header -- mod_headers

相反(只有在具备相应模块的情况下才会使用指令):

<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|txt|html|x-html|php|css|xml|js|woff|ttf|svg|eot)(.gz)?$">
    <IfModule mod_expires.c>
        ExpiresActive On
    </IfModule>
    <IfModule mod_headers.c>
        Header set Expires "Sun, 27 May 2012 00:00:00 GMT"
        Header unset ETag
    </IfModule>
    FileETag None
</FilesMatch>
问题回答

暂无回答




相关问题
Ignore symlinks in clean URL s in .htaccess

Example URL: example.com/user /user is both a symlinked directory and a valid URL to content on my site. I user Horde Routes to request the content and all requests to the site go through index.php. ...

.htaccess File Options -Indexes on Subdirectories

I have the following .htaccess line, simple no indexes on root. Options -Indexes What do we add so it propagates to any sub directory instead of having to create one file for each? One .htaccess on ...

Mod Rewrite ignoring -d

After a day or two, I am still fighting with Mod Rewrite. It seems that 60% of my development time is spent battling the server. My current URL structure is such that all http://example.com/xyz and ...

ErrorDocument 404 Not Sending Referrer Information: PHP

I m using a standard htaccess ErrorDocument 404 to redirect users to a new page. In order to customize the 404, I need to know their referrer information (from the page they Tried to visit). $...

Find all htaccess files on server [closed]

I m looking for a Linux command to go through all the directories on my server and find all .htaccess files. The output would be a list of all those files with full path, creation/modification date ...

301 Redirect Help with Dynamic URL s and Multiple Id s

I just did a redesign for www.wildchildclothes.com which has a new URL structure. The old site ran on Zen Cart and had a bad URL structure. Here are some examples of what I want to redirect from: OLD:...

热门标签