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.

All of my .htaccess files are ignored

Discussion in 'General Discussion' started by Vatoloco, Jul 17, 2005.

  1. Vatoloco

    Vatoloco Well-Known Member

    Joined:
    Jun 21, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    None of my .htaccess files are working. It's like they are being ignored by the server. I did some searching and found that in /etc/httpd/conf/httpd.conf AllowOverride should not be set to none? Mine is set like this:

    <Directory />
    Options All
    AllowOverride All
    </Directory>

    What else could cause all .htaccess fails to not work and just be skipped by the server?
     
  2. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    What is the syntax of the .htaccess entries, can you post what you are trying to override.

    Also, adding something like a phpinfo() and modifiying the .htaccess for php_flags will let you know if the local account setting is overriding the default server setting.

    More info please :)
     
  3. Vatoloco

    Vatoloco Well-Known Member

    Joined:
    Jun 21, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Don't ask me what I was doing wrong before, but all of the sudden it's working today. I had to have my server reset last night (it crashed when processing logs for some reason). I could of swore I restarted http before but maybe it needed a complete restart to work.


    Here's the .htaccess I'm using:

    Code:
    Options +FollowSymlinks
    DirectoryIndex index.shtml index.html index.php
    RewriteEngine on 
    RewriteCond %{HTTP_REFERER} !^$ 
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mywebsite\.com [NC] 
    RewriteRule \.(gif|jpg|jpeg|bmp|png|mpg|mpeg|avi|wmv|mov|asf)$ - [F]
    RewriteCond %{HTTP_HOST} !^www\.mywebsite\.com 
    RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R=permanent,L] 
    <Limit GET PUT POST>
    order allow,deny
    deny from 64.180.41.247
    allow from all
    </Limit>
    I basically use it to stop hotlinking and to make sure the www always shows up in front of my web site name (I've got cookies from one script that cause people to be logged in twice if they go to my site without the www). I always stick another .htaccess in one subdirectory where I want the images to be able to be hotlinked:

    Code:
    Options +FollowSymlinks
    RewriteEngine off
    DirectoryIndex index.shtml index.html index.php
     
Loading...

Share This Page