Reputation: 514
So I had this "beatiful" website that did exactly what I wanted it to do. Then I shut down my PC, reboot and... The pages just download instead of being displayed. I reinstalled XAMPP and launched Apache again and I was able to identify the .htaccess-File as the cause of the problem.
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
They should make it possible to use /de/index instead of /de/index.html - but somehow they cause the page to download if i open localhost/de/index (with localhost/de/index.html it works fine...).
I'm using HTML-Sites with SSI-Elements on a Apache-webserver. The only other file that is different to the out-of-the-box ones is the httpd.conf, where I enabled SSIs:
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
So I hope there is somebody among you that can help me with this annoying problem as I'm quite desperate...
Huge thanks in advance, chrissik
Edit: for some reason, even without the problematic lines chrome keeps downloading the files while IE and opera display the pages...
Upvotes: 2
Views: 1022
Reputation: 514
So I rebooted like 1000 times and reinstalled XAMPP (also a lot of times) and I managed it to display the pages at least again instead of downloading.
The next thing I did was that I checked the SSI section of the httpd.conf
. Normally SSIs should be activated by default (that's what the XAMPP guys say) but as seen above this didn't work for me so I had to edit this code.
I ended up using another tutorial on enabeling SSIs (http://www.hostnet.de/faq/content/6/88/de/wie-erlauben-wir-server-side-includes-ssi-in-allen-verzeichnissen.html - fyi: it's in German) to get the following code:
#AddType text/html .shtml
#AddHandler server-parsed .shtml
AddOutputFilter INCLUDES .shtml .shtm .htm .html
Options Includes
AddType text/html .shtml .shtm .htm .html
With this code, the page runs like before. The SSIs are working, the redirections too and even the mobile detection is running like a charm. But I still have no clue why it stopped working - I'm just hoping it stays that way.
Thanks to anyone who made up their mind about my problem :)
Upvotes: 1