homepage Welcome to WebmasterWorld Guest from 54.81.170.186
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Why do I get a 500 error on remote server but not on localhost?
EvertVd




msg:4300394
 2:05 pm on Apr 19, 2011 (gmt 0)

I am probably too tired to see straight, but for some reason i get a 500 error when I upload this htaccess, while it works ok on my WAMP server.
Does anyone see what could be the problem?


# ---------------------------------------------------------
# Some extra security
# ---------------------------------------------------------

<Files ".htaccess">
order allow,deny
deny from all
</Files>

Options +FollowSymLinks

# ---------------------------------------------------------
# Prevent directory browsing & access to .dirs
# ---------------------------------------------------------

Options -Indexes
IndexIgnore *

<IfModule mod_rewrite.c>
RewriteRule "(^|/)\." - [F]
</IfModule>

# ---------------------------------------------------------
# Scripts
# ---------------------------------------------------------

Options +ExecCGI
AddHandler cgi-script cgi

Options +Includes
XBitHack on

# ---------------------------------------------------------
# Make sure we show te right page
# ---------------------------------------------------------

DirectoryIndex index.php index.html

# ---------------------------------------------------------
# MIME types (partly from html5 boilerplate)
# ---------------------------------------------------------

AddType audio/ogg oga ogg spx
AddType audio/flac flac
AddType video/ogg ogv
AddType video/mp4 mp4
AddType video/webm webm
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
AddType application/vnd.ms-fontobject eot
AddType font/truetype ttf
AddType font/opentype otf
AddType application/x-font-woff woff
AddType image/x-icon ico
AddType application/x-httpd-php inc

# ---------------------------------------------------------
# Set Charset and Headers
# ---------------------------------------------------------

AddCharset UTF-8 .htm .html .php .inc .css .js .xml .json .rss

<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(html|htm|php)$">
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
Header set imagetoolbar "no" env=ie
</FilesMatch>
Header append Vary User-Agent
</IfModule>
</IfModule>

# ---------------------------------------------------------
# Configure cache-ing (css is dynamic)
# ---------------------------------------------------------

<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 years"
<FilesMatch "\.(htm|html|xml|txt|php|inc)$">
ExpiresDefault "access plus 1 seconds"
</FilesMatch>
</ifModule>

<ifModule mod_headers.c>
Header unset ETag
Header unset Last-Modified
</ifModule>

FileETag None

# ---------------------------------------------------------
# Compression
# ---------------------------------------------------------

<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|htm|html|xml|inc|php|ttf|otf|eot|svg)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

# ---------------------------------------------------------
# Custom errors
# ---------------------------------------------------------

Options -MultiViews

 

g1smd




msg:4300401
 2:14 pm on Apr 19, 2011 (gmt 0)

You have missed out the required RewriteEngine On line.

The options line should go near the RewriteEngine On line and you should combine all five lines into one.

Options +FollowSymLinks
Options -Indexes
Options +ExecCGI
Options +Includes
Options -MultiViews

becomes:

Options +FollowSymLinks -Indexes +ExecCGI +Includes -MultiViews


I don't use quotes:

RewriteRule "(^|/)\." - [F]

and prefer:

RewriteRule (^|/)\. - [F]

or similar.


The |htm|html| pattern simplifies to |html?| in several places.

EvertVd




msg:4300431
 2:41 pm on Apr 19, 2011 (gmt 0)

Thanks, but that was not it.

I decided to remove all lines one by one and then add them again one by one. And the problem is with the lines:

Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
Header set imagetoolbar "no" env=ie

When I remove those it works again.
So now I have to figure out why those would trigger a 500?

EvertVd




msg:4300438
 2:52 pm on Apr 19, 2011 (gmt 0)

Oh. Never mind. It seems the server runs Apache 1.3 :-( wow, dinosaurs.

g1smd




msg:4300450
 3:07 pm on Apr 19, 2011 (gmt 0)

Ah, didn't think of that - but do fix the other issues too.

EvertVd




msg:4300461
 3:16 pm on Apr 19, 2011 (gmt 0)

I will, thanks.

jdMorgan




msg:4303766
 7:19 pm on Apr 25, 2011 (gmt 0)

Apache 1.3.x supports mod_headers, so this is not likely a matter of an old Apache server, but rather of mod_headers not being loaded on this particular server.

First stop after an error is the server error log file, which often tells you exactly what's wrong... I don't see that info posted here.

Jim

Bert36




msg:4303783
 8:01 pm on Apr 25, 2011 (gmt 0)

It's not the headers module that is the problem it's the environment variables which are not supported in the older Apache version (env=ie) so that was probably the problem.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved