The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

htaccess don't work

Discussion in 'General Discussion' started by xcoder, Jun 27, 2007.

  1. xcoder

    xcoder Member

    Joined:
    Aug 28, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi to all,
    I have a problem. htaccess file works on all account but there is a special situation.
    In a account htacces file works just at root not at sub folder.

    For example working on /home/webtek but on /home/webtek/public_html don't work...

    Is there any answer?
    Thanks to all...
     
  2. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    That would be strange indeed.

    /home/webtek would be a home directory
    - apache would not be serving content from there

    /home/webtek/html would be (should be) the web root as far as apache is concerned

    So, unless you've got something severely misconfigured, the .htaccess _should_ work in /home/webtek/html but should _not_ work in /home/webtek.

    Mike
     
  3. xcoder

    xcoder Member

    Joined:
    Aug 28, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi Mike,
    Our config lines is here:
    Code:
    <VirtualHost 62.68.206.130>
    ServerAlias www.webtek.com.tr webtek.com.tr
    ServerAdmin webmaster@webtek.com.tr
    DocumentRoot /home/webtek/public_html
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home/webtek/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule mod_php5.c>
    php_admin_value open_basedir "/home/webtek/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    ServerName www.webtek.com.tr
    
    <IfModule mod_suphp.c>
      suPHP_UserGroup webtek webtek
    </IfModule>
    
    User webtek
    Group webtek
    BytesLog /usr/local/apache/domlogs/www.webtek.com.tr-bytes_log
    CustomLog /usr/local/apache/domlogs/www.webtek.com.tr combined
    Options -ExecCGI -Includes
    </VirtualHost>
    
     
  4. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    Considering this:

    Code:
    DocumentRoot /home/webtek/public_html
    
    There is no way that you would be able to tell if .htaccess in /home/webtek was working or not. Apache isn't paying attention to the .htaccess file in /home/webtek since it is outside of the web root. The only place Apache could look at .htacess files is within /home/webtek/public_html and folders inside of that.

    You had stated that the .htaccess file in /home/webtek works but the .htaccess file in /home/webtek/public_html does not work. But I don't know how that could possibly be since /home/webtek/.htaccess is outside of the document root (i.e. web root).

    1. SSH into machine and su to root
    2. tail -f /usr/local/apache/logs/error_log
    3. Put the .htaccess in a directory inside of /home/webtek/public_html (make sure its owned by the user webtek)
    4. Go to the URL of the main website served under the webtek account

    When you go to the URL and get the error, look back in your SSH screen at the error_log that is tailing. You can hit CTRL-C to stop it. You'll see the error in there.

    For instance, my site runs on a server running phpSUEXEC. I can't put PHP values in .htaccess files. I put 'php_value register_globals on' in my .htaccess file and then went to the website.

    The error that showed up in error_log was:

    [Wed Jun 27 21:23:05 2007] [alert] [client xxx.xxx.xxx.xxx] /home/xxxxx/public_html/yyyyy/werd/.htaccess: Invalid command 'php_value', perhaps mis-spelled or defined by a module not included in the server configuration

    Obviously, your error will be different. But the error_log will tell you why it was barking.

    - Mike
     
Loading...

Share This Page