【发布时间】:2013-11-16 14:01:36
【问题描述】:
所以我有了这个“美丽”的网站,它完全按照我的意愿去做。然后我关闭了我的电脑,重新启动并... 页面只是下载而不是显示。 我重新安装了 XAMPP 并再次启动了 Apache,我能够确定 .htaccess-File 是问题的原因。
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{QUERY_STRING} !^desktop
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos" [NC]
RewriteRule ^/?$ /mobile/index [L,R=302]
RewriteRule ^/?$ /de/index [R]
//Here is the problem i guess:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
它们应该可以使用 /de/index 而不是 /de/index.html - 但是如果我打开 localhost/de/index (使用 localhost/de/index.html 它可以工作),它们会以某种方式导致页面下载好吧...)。
我在 Apache 网络服务器上使用带有 SSI 元素的 HTML 站点。与开箱即用的文件不同的唯一其他文件是 httpd.conf,我在其中启用了 SSI:
AddType text/html .shtml
AddHandler server-parsed .shtml
AddHandler server-parsed .html
AddHandler server-parsed .htm
Options Indexes FollowSymLinks Includes
AddOutputFilter INCLUDES .shtml
Options +Includes
所以我希望你们当中有人可以帮助我解决这个烦人的问题,因为我非常绝望......
提前非常感谢, 克里斯克
编辑:出于某种原因,即使没有有问题的行,chrome 也会继续下载文件,而 IE 和 opera 显示页面...
【问题讨论】:
-
我认为 webmasters.stackexchange 或 serverfault.com 更有可能在这个问题上得到很好的答案。