Results 1 to 14 of 14
  1. #1
    Join Date
    Jul 2005
    Location
    ::Computer World::
    Posts
    9

    Apache Mod Problem

    I am one of the Support Team members of my host. Recently a problem was brought into my knowledge. The Apache mod "mod_rewrite" doesn't work in our server. Whenever a person adds the 3 lines of code into the ".htaccess" file, and tries to access the website. He always gets a "500 Internal Error". Is there any reason why this is happening. And, what can be done to solve this. BTW, it is a Linux Server.

    ~ CC

  2. #2
    Join Date
    Jun 2005
    Location
    India
    Posts
    123

    Re: Apache Mod Problem

    Hello,

    Did you enable the .htaccess option in your conf file?, It seems that the .htaccess option is disabled in your conf file. Check your apache config file and enable the option to " AllowOverride All "

    Let me know the status

    With regards,
    Bijo

  3. #3
    Join Date
    Jun 2003
    Location
    World Wide Web
    Posts
    581
    Well, it is not the Override option alone that may be causing this. I suspect an error in the mod_rewrite rules.
    SupportExpertz.com - the name says it all!
    Managed Cloud Servers
    Server Management and Monitoring
    24x7 outsourced customer support

  4. #4
    Join Date
    Jun 2005
    Location
    India
    Posts
    123
    Hello,

    Is it a server wide issue or problem with only one doamin. If it is a server wide issue please check the following entry in your apache config.
    ------------------------------------------------
    LoadModule rewrite_module libexec/mod_rewrite.so

    and
    AddModule mod_rewrite.c
    -------------------------------------------------

    Is any other .htaccess file working on your server ? if no check the apache config and enable the "AllowOverride All" option in your apache .htaccess section.

    Also check your apache error log and paste the result here. It will help us to find out the issue.

    With regards,
    Bijo
    Last edited by bijo; 07-25-2005 at 02:59 AM.

  5. #5
    Join Date
    Apr 2000
    Location
    California
    Posts
    3,051
    Just what rules were you trying to add that caused this error? That might be the best first question.

    PS: You may or may not want to add AllowOverride All to the configuration. That isn't the fix per se, even if it does allow for a quick fix, it might be less secure (depending on the set up and what you want to allow or not)--if that's even part of the problem.

  6. #6
    Join Date
    Jul 2005
    Location
    ::Computer World::
    Posts
    9
    It is a server-wide issue. Thank you. I will check up those things and reply.

    ~ CC

  7. #7
    Join Date
    Jul 2005
    Location
    ::Computer World::
    Posts
    9
    Okay, the options are all enabled now. I have tried http://pokedrome.com as a test site. As you see, it uses this format for links "http://pokedrome.com/index.php?id=1". Now, I have added this to my .htaccess file to enable mod_rewrite. Tell me if this is correct.
    Code:
    RewriteEngine On
    Options +FollowSymlinks
    RewriteRule ^(.*).php /index.php?id=$1
    Thank you
    ~ CC

  8. #8
    Join Date
    Apr 2000
    Location
    California
    Posts
    3,051
    Is it working now? What was the fix you eventually had to implement? If not, it might be something else, though the rules themselves shouldn't cause the error based on the one you posted above. Here's a modified version, to prevent an endless loop:

    Code:
    Options +FollowSymlinks # I moved this above, since it's not a rewrite rule.
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/index\.php #prevent looping
    RewriteRule ^(.*)\.php$ /index.php?id=$1  # . (a dot) = any character, so be sure to use \. and also use the end of string character $ on \.php$.
    Just some suggestions. Also, be sure the .htaccess file is chmod 644 regarding permissions.

  9. #9
    Join Date
    Jul 2005
    Location
    ::Computer World::
    Posts
    9
    The .htaccess is CHMODD'ed "644". And when I added this to the .htaccess file, I get an error
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@pokedrome.info and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    I don't think it is a sever-wide issue now as the server webmaster and I went through the files and all Mod_rewrite was on the allowed mods. Anyone can help me? Perhaps, do you want to see my .htaccess file?

    ~ CC
    Last edited by Chrono Cr@cker; 07-26-2005 at 10:01 PM.

  10. #10
    Join Date
    Apr 2000
    Location
    California
    Posts
    3,051
    Comment out all the directives in it, first. Such as:

    # Options +FollowSymlink

    Then try it.

    Try just enabling only the RewriteEngine On directive and see if that still errors.

  11. #11
    Join Date
    Jul 2005
    Location
    ::Computer World::
    Posts
    9
    A good news. It works when I add just RewriteEngine On. What to do next?

    And Tom, thanks a ton for your help. I am learning a lot.

    ~ CC

  12. #12
    Join Date
    Jul 2005
    Location
    ::Computer World::
    Posts
    9
    Please help me.

    ~ CC

  13. #13
    Join Date
    Apr 2000
    Location
    California
    Posts
    3,051
    Sorry, I was away for a few days and don't check WHT very often unless I get the autoresponse telling me there was a new post in the thread. PM me any details and I'll help you out later tonight.

  14. #14
    Join Date
    Jul 2003
    Posts
    277
    Originally posted by Chrono Cr@cker
    The .htaccess is CHMODD'ed "644". And when I added this to the .htaccess file, I get an error


    I don't think it is a sever-wide issue now as the server webmaster and I went through the files and all Mod_rewrite was on the allowed mods. Anyone can help me? Perhaps, do you want to see my .htaccess file?

    ~ CC
    Looking at your error log usualy will tell you why it did that.
    Perl
    Java
    SQL

Posting Permissions

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