Forums / Install & configuration / .htaccess is not read by Apache

.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

eZ debug

Timing: Jan 18 2025 23:15:08
Script start
Timing: Jan 18 2025 23:15:08
Module start 'content'
Timing: Jan 18 2025 23:15:09
Module end 'content'
Timing: Jan 18 2025 23:15:09
Script end

Main resources:

Total runtime1.2983 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 587.8281180.8281
Module start 'content' 0.00671.1634 768.6563554.4375
Module end 'content' 1.17010.1281 1,323.0938336.7578
Script end 1.2982  1,659.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3140210.0002
Check MTime0.00150.1130210.0001
Mysql Total
Database connection0.00080.062210.0008
Mysqli_queries1.223494.23301940.0063
Looping result0.00190.14961920.0000
Template Total1.267797.620.6339
Template load0.00220.171120.0011
Template processing1.265597.472120.6327
Template load and register function0.00020.013210.0002
states
state_id_array0.00100.078910.0010
state_identifier_array0.00120.091020.0006
Override
Cache load0.00190.1450410.0000
Sytem overhead
Fetch class attribute can translate value0.00120.090530.0004
Fetch class attribute name0.00100.075240.0002
XML
Image XML parsing0.00100.075930.0003
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00500.3843270.0002
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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