我使用的1and1,我按照本指南,以便儘可能多的我的網站的壓縮,我可以:htaccess,如何使用gzip壓縮+隱藏.html擴展名?
我以前也用我的htaccess文件來隱藏HTML擴展的每個網頁。現在我已經應用了新的代碼來通過路由它來壓縮一切,我不再隱藏html擴展,並且我的許多web鏈接都被破壞了。這是我的htaccess文件的複製粘貼。
Header unset Pragma
FileETag None
Header unset ETag
# cache images/pdf docs for 10 days
<FilesMatch "\.(ico|pdf|jpg|jpeg|png|gif|css)$">
Header set Cache-Control "max-age=864000, public, must-revalidate"
Header unset Last-Modified
</FilesMatch>
# cache html/htm/xml/txt diles for 2 days
<FilesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</FilesMatch>
# tells the server to process all the file extensions specified through PHP5 for compression purposes
RemoveHandler .css
AddType x-mapp-php5 .php .shtml .html .htm .txt .js .css .ttf .svg .woff
#
Options +FollowSymLinks
RewriteEngine On
#
# REDIRECT /folder/index.html to /folder/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html$ http://weaverinnovations.com/$1 [R=301,L]
#
這樣的事情遠遠超出了我的專業領域,以及任何幫助,以及如何避開衝突的解釋將不勝感激。
謝謝!
也許是一個明顯的問題,但是您是否在重新啓動瀏覽器之間對.html擴展名進行.htaccess更改?使用301重定向您的瀏覽器將「記住」這些,直到您重新啓動....由於忽略了這個事實而導致了一個以上的頭痛。 – 2012-02-06 23:14:18