.htaccess Not Working With AllowOverride All


 
Thread Tools Search this Thread
Top Forums Web Development .htaccess Not Working With AllowOverride All
# 1  
Old 01-04-2012
.htaccess Not Working With AllowOverride All

Quote:
A good test for this is to put garbage in your .htaccess file and reload. If a server error is not generated, then you almost certainly have AllowOverride None in effect.
Source: Apache.org

The .htaccess file is not read by the server based the test above and the lack of change in the operation of the server.

httpd.conf
Code:
<Directory />
    Options None
    AllowOverride All
    # Initially this was set to None and I would prefer it be again, just testing
    Order deny,allow
    Deny from all
</Directory>

AccessFileName .htaccess

Include default-server.conf

default-server.conf

Code:
<Directory "/dir/dir/dir/dir">
    AllowOverride All
    Options All
</Directory>

The .htaccess file is r by the web server user and group and exists in the correct directory.

Anyone know why this file is not working?

Thanks!
# 2  
Old 01-04-2012
Did you restart the server after modifications?
# 3  
Old 01-04-2012
Quote:
Originally Posted by vbe
Did you restart the server after modifications?
Yes, and confirmed the server was stopped / no processes before restarting.
# 4  
Old 01-18-2012
I'm still stuck on this one. Anyone with a fresh idea for me to chase down? Thx
# 5  
Old 01-18-2012
check the apache logs to see if there are any relevant log entries. Do you get any errors when visiting a page in that directory or is the .htaccess just getting ignored? please post the contents of .htaccess so we can see what your trying to do.
# 6  
Old 01-21-2012
Quote:
Originally Posted by frank_rizzo
check the apache logs to see if there are any relevant log entries.
Been through those a few times

Quote:
Originally Posted by frank_rizzo
Do you get any errors when visiting a page in that directory or is the .htaccess just getting ignored?
Its just ignored. Here's the output from:

Code:
server:/var/log/apache2 # clear ; echo ACCESS ; tail -n 15  www.domain.com-access_log ; echo ERROR ; tail -n 15  www.domain.com-error_log

Code:
ACCESS
1.2.3.4 - - [21/Jan/2012:19:17:43 -0330] "GET /filename.php HTTP/1.1" 200 61184 "-" "Mozilla/5.0 (X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
1.2.3.4 - - [21/Jan/2012:19:17:43 -0330] "GET /enviro.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2524 "http://www.domain.com/filename.php" "Mozilla/5.0 (X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
1.2.3.4 - - [21/Jan/2012:19:17:43 -0330] "GET /enviro.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2146 "http://www.domain.com/filename.php" "Mozilla/5.0 (X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
ERROR

Quote:
Originally Posted by frank_rizzo
please post the contents of .htaccess so we can see what your trying to do.
Code:
server:/dir/dir/dir/www.domain.com # cat .htaccess

Code:
wysisyg <- this line should generate an error to confirm file is parsed. it doesn't 

  RewriteCond %{REQUEST_FILENAME} !-f                                                                                                                                               
  RewriteCond %{REQUEST_FILENAME} !-d                                                                                                                                               
  RewriteCond %{REQUEST_URI} !=/favicon.ico                                                                                                                                         
  RewriteRule ^ index.php [L]                                                                                                                                                       
                                                                                                                                                                                    
  # Rules to correctly serve gzip compressed CSS and JS files.                                                                                                                      
  # Requires both mod_rewrite and mod_headers to be enabled.
  <IfModule mod_headers.c>
    # Serve gzip compressed CSS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.css $1\.css\.gz [QSA]

    # Serve gzip compressed JS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.js $1\.js\.gz [QSA]

    # Serve correct content types, and prevent mod_deflate double gzip.
    RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
    RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]

    <FilesMatch "(\.js\.gz|\.css\.gz)$">
      # Serve correct encoding type.
      Header set Content-Encoding gzip
      # Force proxies to cache gzipped & non-gzipped css/js files separately.
      Header append Vary Accept-Encoding
    </FilesMatch>
  </IfModule>
</IfModule>

Above is the stock .htaccess file that ships with Drupal 7 (other than the first two lines which are intended to generate an error.)

Thanks for offering some suggestions...
# 7  
Old 01-31-2012
Everyone stumped? Me too! :-)
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed -i '11 b; s/AllowOverride None\b/AllowOverride All/' test

I searched everywhere and have had no luck. here is what I'm trying to do. sed -i '11 b; s/AllowOverride None\b/AllowOverride All/' test I have a single file I want to edit one line that appears 4 times. in this case line 11. I want to change it from AllowOverride None to AllowOverride All... (2 Replies)
Discussion started by: lmao32895
2 Replies

2. Web Development

.htaccess redirect with #

I have the following directive in my .htaccess: #RewriteRule ^mozrank/?$ "http://www.seobook.com/#a_aid=dh" The problem is that the redirect is going to http://www.seobook.com/%23a_aid=dh How to preserve the # when redirecting? (2 Replies)
Discussion started by: rlopes
2 Replies

3. UNIX for Advanced & Expert Users

Redirect with htaccess

Hi, I would like to use htaccess 301 redirect with URL hiding. Ex: when browse the website 'abc.com' it should show the contents of the page 'xyz.com/start/index.html' but in addressbar should show the domain 'abc.com'. I know it works with html URL frame rewrite. But my question is it... (0 Replies)
Discussion started by: chandranjoy
0 Replies

4. UNIX for Dummies Questions & Answers

http to https Apache, AllowOverride All receives 403 err htaccess

Hi new to the forum, I have a Apache server on CentOS which hosts a web site. I've set up the SSL which has been tested as I can access my website via http and https. I would like to redirect all browsers to use https instead of http. I have created the htaccess file which contains 'Allow... (3 Replies)
Discussion started by: Sai245
3 Replies

5. Cybersecurity

Logging htaccess

hi i am trying to make a log of all users who access my website, i am using htaccess to administrate logins, how does htaccess store a session i.e where is the valid user login temporarily stored while a user is using the site or is there already some sort of logging being done by htaccess. ... (2 Replies)
Discussion started by: omnibarb
2 Replies

6. Cybersecurity

htaccess

Something is wrong. I do everything right make the .htaccess file and stuff, but when I try the htpasswd command it says command not found. I use Putty SSH client and I think server is running RedHat 7.1 with Apache some version. HELP!!! (1 Reply)
Discussion started by: _hp_
1 Replies

7. UNIX for Dummies Questions & Answers

.htaccess

i want to protect a folder on my HP.... does the folder need more than ".htaccess" and ".htpasswd" to be protected , and ask for login and password??? Please help ...... i use HTAdmin 1.2.1 to manage my access files.. The systemadmin cant or wount answer.....:confused: Avenger (3 Replies)
Discussion started by: Avenger
3 Replies

8. UNIX for Dummies Questions & Answers

.htaccess?

For a schoolproject, I have to set up an intranet at a company headquarters in the Netherlands. But they want to give the division in the United States access to that intranet. I have to find out how to do that. I've heard that you can do that by giving certain people access to the intranet with... (1 Reply)
Discussion started by: Puc conDoin
1 Replies
Login or Register to Ask a Question