Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2009
    Location
    Moore, OK
    Posts
    282
    Thanks
    11
    Thanked 41 Times in 41 Posts

    .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.

  • #2
    Regular Coder
    Join Date
    May 2009
    Location
    Moore, OK
    Posts
    282
    Thanks
    11
    Thanked 41 Times in 41 Posts
    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.

  • #3
    Regular Coder
    Join Date
    May 2009
    Location
    Moore, OK
    Posts
    282
    Thanks
    11
    Thanked 41 Times in 41 Posts
    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.


  •  

    LinkBacks (?)


    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •