homepage Welcome to WebmasterWorld Guest from 54.237.99.131
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
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#: 4300392 posted 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

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4300392 posted 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#: 4300392 posted 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#: 4300392 posted 2:52 pm on Apr 19, 2011 (gmt 0)

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

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4300392 posted 3:07 pm on Apr 19, 2011 (gmt 0)

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

EvertVd



 
Msg#: 4300392 posted 3:16 pm on Apr 19, 2011 (gmt 0)

I will, thanks.

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4300392 posted 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

5+ Year Member



 
Msg#: 4300392 posted 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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved