.htaccess is not read by Apache

Author Message

Pascal France

Monday 27 August 2007 12:25:49 pm

Hi,

During the update from 3.9.2 to 3.9.3 I would like to do a temporary redirection. So, I created a .htaccess with this line inside:

Redirect 302 / http://www.luxpopuli.fr/maintenance.txt?urlend=

(I tried many other syntaxes without more success)

and I created the maintenance.txt file too.

I don't understand why my .htaccess is not read by Apache 1.3.37.
I use a virtualhost which works fine:

NameVirtualHost 88.191.68.68:80
<VirtualHost 88.191.68.68:80>

    DocumentRoot /usr/local/www
    ServerName www.luxpopuli.fr
    DirectoryIndex index.php index.html

    <Directory /usr/local/www>
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <IfModule mod_php4.c>
        php_admin_flag safe_mode Off
        php_admin_value register_globals    0
        php_value magic_quotes_gpc  0
        php_value magic_quotes_runtime  0
        php_value allow_call_time_pass_reference 0
    </IfModule>

    DirectoryIndex index.php
    <IfModule mod_rewrite.c>

        RewriteEngine On
        Rewriterule ^/var/storage/.* - [L]
        Rewriterule ^/var/[^/]+/storage/.* - [L]
        RewriteRule ^/var/cache/texttoimage/.* - [L]
        RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
        Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
        Rewriterule ^/share/icons/.* - [L]
        Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
        Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
        RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
        RewriteRule ^/favicon.ico - [L]
        RewriteRule ^/robots.txt - [L]

        RewriteRule ^/* /index.php

    </IfModule>

</VirtualHost>

and above this section I can find:

<Directory "/usr/local/www">
    Options Indexes Includes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

AccessFileName .htaccess

phpinfo() gives me:

Loaded Modules

mod_deflate, mod_perl, mod_fastcgi, mod_php4, mod_ssl, mod_setenvif, mod_so, mod_usertrack, mod_headers, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_mime_magic, mod_log_config, mod_env, mod_vhost_alias, http_core

Thanks for your help.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Bruce Morrison

Monday 27 August 2007 4:12:25 pm

Hi Pascal

I suspect that the "AllowOverride None" line is the issue. This line disables .htaccess files.

http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Pascal France

Tuesday 28 August 2007 12:13:39 am

Hi Bruce,

You're absolutely right.
I have to convert temporary:

   <Directory /usr/local/www> 
       Options FollowSymLinks 
       AllowOverride None 
   </Directory>

to

   <Directory /usr/local/www> 
       Options All 
       AllowOverride All 
   </Directory>

Once this done, I creat this .htaccess (with VirtualHost):

RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteCond %{REMOTE_ADDR} !^96\.204\.128\.89
RewriteRule $ /maintenance.html [R=302,L]

...and the maintenance.html file

Without VirtualHost, I can use this .htaccess:

Redirect 302 / http://www.luxpopuli.fr/maintenance.php?urlend=

Regards

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 02:43:04
Script start
Timing: Jan 19 2025 02:43:04
Module start 'layout'
Timing: Jan 19 2025 02:43:04
Module start 'content'
Timing: Jan 19 2025 02:43:05
Module end 'content'
Timing: Jan 19 2025 02:43:05
Script end

Main resources:

Total runtime1.2867 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.2734152.6406
Module start 'layout' 0.00620.0025 741.914139.4766
Module start 'content' 0.00871.2766 781.3906549.3438
Module end 'content' 1.28540.0013 1,330.734412.1484
Script end 1.2867  1,342.8828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2811160.0002
Check MTime0.00170.1299160.0001
Mysql Total
Database connection0.00100.074810.0010
Mysqli_queries1.226595.3228570.0215
Looping result0.00060.0469550.0000
Template Total1.246796.920.6233
Template load0.00210.164620.0011
Template processing1.244596.723320.6223
Template load and register function0.00020.019010.0002
states
state_id_array0.00140.110910.0014
state_identifier_array0.00090.073520.0005
Override
Cache load0.00180.1427410.0000
Sytem overhead
Fetch class attribute can translate value0.00070.051420.0003
Fetch class attribute name0.00130.100940.0003
XML
Image XML parsing0.00060.044120.0003
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00080.0622160.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs