Results 1 to 10 of 10
  1. #1

    apache not reading .htaccess file?

    one of my clients has a .htaccess file in their main content directory. this file worked fine with their old server, but is not working on the new server i moved the site to.

    the server is redhat enterprise 3.

    anyone have any ideas?

    below is the .htaccess file:

    Code:
    <FilesMatch "(home|feature|editor|newswire|otherpress|admin|pbook|media|mod)">
    ForceType application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.inc">
    Order allow,deny
    Deny from all
    </FilesMatch>
    php_flag register_globals off
    php_flag display_errors off
    php_flag log_errors on
    php_flag track_vars on
    php_flag track_errors on
    php_flag magic_quotes_gpc off
    php_flag mysql.allow_persistent on
    php_value max_execution_time 150
    php_value memory_limit 16M
    php_value error_reporting 'E_ALL & ~E_NOTICE'
    php_value include_path .:/usr/share/pear
    php_value error_log /httpdocs/****/dadalogs/php-error.log
    php_value post_max_size 20M
    php_value upload_max_filesize 20M
    Vagrant Web Hosting - U.S. / CANADA
    Website Hosting - Website Development - Content Management
    NEW: Windows Hosting w/ ASP.NET

  2. #2
    Join Date
    Dec 2002
    Location
    NY, NY
    Posts
    3,975
    is it in the root dir?

  3. #3
    no, it's in a sub-directory. /httpdocs/dada
    Vagrant Web Hosting - U.S. / CANADA
    Website Hosting - Website Development - Content Management
    NEW: Windows Hosting w/ ASP.NET

  4. #4
    anyone? i'm really stumped. i got the advice "Try putting the php admin tags in vhost.conf file in the "conf" folder", but i'm not sure what php admin tags to put in there.
    Vagrant Web Hosting - U.S. / CANADA
    Website Hosting - Website Development - Content Management
    NEW: Windows Hosting w/ ASP.NET

  5. #5
    Join Date
    Apr 2004
    Posts
    52
    Have you checked the error logs? Generally if Apache finds something wrong with a .htaccess file it will report it.

  6. #6
    if you're referring to /var/log/httpd error logs, there's nothing in reference to an .htaccess in there.
    Vagrant Web Hosting - U.S. / CANADA
    Website Hosting - Website Development - Content Management
    NEW: Windows Hosting w/ ASP.NET

  7. #7
    check your apache conf/httpd.conf file. it's possible the server is using something besides '.htaccess' -- search for "AccessFileName" by default it should be:
    AccessFileName .htaccess

    also you can turn .htaccess on/off in a specific directory using:
    AllowOverride All
    to allow .htaccess to override all settings or
    AllowOverride None
    to turn .htaccess off in a directory. there's also a list of specific things you can put there to allow/block

    just make sure that "AllowOverride" isn't set to "None" in your client's and/or your apache root <Directory /> settings

  8. #8

    Re: apache not reading .htaccess file?

    Originally posted by VagrantHost
    one of my clients has a .htaccess file in their main content directory. this file worked fine with their old server, but is not working on the new server i moved the site to.

    the server is redhat enterprise 3.

    anyone have any ideas?

    below is the .htaccess file:

    Code:
    <FilesMatch "(home|feature|editor|newswire|otherpress|admin|pbook|media|mod)">
    ForceType application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.inc">
    Order allow,deny
    Deny from all
    </FilesMatch>
    php_flag register_globals off
    php_flag display_errors off
    php_flag log_errors on
    php_flag track_vars on
    php_flag track_errors on
    php_flag magic_quotes_gpc off
    php_flag mysql.allow_persistent on
    php_value max_execution_time 150
    php_value memory_limit 16M
    php_value error_reporting 'E_ALL & ~E_NOTICE'
    php_value include_path .:/usr/share/pear
    php_value error_log /httpdocs/****/dadalogs/php-error.log
    php_value post_max_size 20M
    php_value upload_max_filesize 20M
    Try changing this

    Code:
    <FilesMatch "(home|feature|editor|newswire|otherpress|admin|pbook|media|mod)">
    ForceType application/x-httpd-php
    </FilesMatch>
    To this

    Code:
    <FilesMatch "(home|feature|editor|newswire|otherpress|admin|pbook|media|mod)">
    ForceType application/x-httpd-php
    AcceptPathInfo On    #add this line
    </FilesMatch>
    I had the same problem with a client when we updated Apache.

    Seems Apache2 uses .htaccess a little differently
    A new Beginning for WebMasters
    WebMasters Forum
    TotalWeb International Net Consulting
    Internet Consulting, Hosting and Business Solutions

  9. #9
    i'm getting a 500 internal server error.
    Vagrant Web Hosting - U.S. / CANADA
    Website Hosting - Website Development - Content Management
    NEW: Windows Hosting w/ ASP.NET

  10. #10
    I can agree with "ricocheting". I had a similar issue with my .htaccess file not being read and I looked at the virtual host configuration for the site in question and found that the AllowOverride was set to None.

    After I changed that my .htaccess file was being read

Posting Permissions

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