Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-01-2009, 03:15 AM   PM User | #1
Coyote6
Regular Coder

 
Join Date: May 2009
Location: Moore, OK
Posts: 277
Thanks: 10
Thanked 41 Times in 41 Posts
Coyote6 is an unknown quantity at this point
.htaccess Error when posting more than 1 line of code

Ok, I've been at this .htaccess problem for way too long now and I am completely fed up and out of ideas on how to resolve the issue. I am running Apache 2 on my Mac which is running OS X 10.5 and have the httpd.conf set to this:

LoadModule proxy_module libexec/apache2/mod_proxy.so (which is on by default but someone said it needs to be on)
LoadModule rewrite_module libexec/apache2/mod_rewrite.so

<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>

<Directory "/MyRootDirectory">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Then in my user file:
<Directory "/MyRootDirectory">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Then just a one line .htaccess code works:
ErrorDocument 404 /

But then you add a second line:
ErrorDocument 404 /
ErrorDocument 500 /500.php

I get a 500 internal server error. I know it's something I probably have set wrong in my config file but I'm lost on what it is. I have also tried "Options FollowSymLinks" in all of the directories but that didn't help either. I have seen other post saying that it my be the editor but I have used both TextEdit as plain text and Dreamweaver. I can't even add the <IfModule></IfModule> line. If someone could help me out I would appreciate it. If I didn't see how useful this could be I wouldn't even bother with it but the search engine optimizing possibilities with it are so great. Anyways thanks.
Coyote6 is offline   Reply With Quote
Old 05-01-2009, 06:01 AM   PM User | #2
Coyote6
Regular Coder

 
Join Date: May 2009
Location: Moore, OK
Posts: 277
Thanks: 10
Thanked 41 Times in 41 Posts
Coyote6 is an unknown quantity at this point
Here are some of the different error messages I am seeing from the log. Of course I don't know what I tried when I got each of these errors.

[Thu Apr 30 18:43:18 2009] [alert] [client ::1] /Sites/.htaccess: <IfModule takes one argument, Container for directives based on existance of specified modules

[Thu Apr 30 19:07:17 2009] [alert] [client ::1] /Sites/.htaccess: ErrorDocument takes two arguments, Change responses for HTTP errors

[Thu Apr 30 19:09:56 2009] [alert] [client ::1] /Sites/.htaccess: Expected </IfModule> before end of configuration

After looking at it, I believe these may have just been from me testing. But just in case they help someone to solve my issue I figured I would post them anyways. Thanks again for any help.
Coyote6 is offline   Reply With Quote
Old 05-27-2009, 08:19 AM   PM User | #3
Coyote6
Regular Coder

 
Join Date: May 2009
Location: Moore, OK
Posts: 277
Thanks: 10
Thanked 41 Times in 41 Posts
Coyote6 is an unknown quantity at this point
Okay got the answer to the issue in case anyone runs into the same problem. The issue is the text editor. TextEdit (even in plain text mode) and Dreamweaver both do not do a true return when making a new line. I had to take the file into my Windows VM and use notepad :/ in order to see that it was placing all of my code into a single line with little squares marking the returns. I knew notepad2 for windows did this but I did not think Dreamweaver or TextEdit did. Long story short the issue is finally solved and it amounts to using the correct text editor.

Now can anyone please suggested a plain text editor for mac that will not add those little square boxes for returns? Thanks.
Coyote6 is offline   Reply With Quote
Reply

Bookmarks

Tags
.htaccess, 500, error, line, mod_rewrite

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:06 AM.


Advertisement
Log in to turn off these ads.