Forums / Install & configuration / .htaccess question

.htaccess question

Author Message

Marco Zinn

Sunday 18 January 2004 3:41:02 am

Hi folks,
I'm lucky to have my own webserver(s), so i can set up Virtual hosts with Rewrite rules for my ez-installations.
But as there are lots of (similar) questions arising here from persons with "URL, non-virtual-hosts"-Installs, i tried such an install, too.
To cut it short: It worked quite well. Currently, I'm fighting with the "safe mode" restriction, which does not let me call ImageMagick (my GD version is 1.6...to low).
After I saw the user and admin sites, could log in and navigate, i remembered the .htaccess advice from the installer. So, i use the provided .htaccess_root file (renamed it) and voila: I got 403 (access denied) errors all over. I could not access anything.

WHAT'S THAT?
Can someone please explain me, what happened and how the provided file should work?

This is the file's contents:
# Copy this file to a new file called .htaccess in your eZ publish root
# to make the site more secure in non-virtualhost mode (index.php used in urls).
#

<FilesMatch ".">
order allow,deny
deny from all
</FilesMatch>

<FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html))$">
order allow,deny
allow from all
</FilesMatch>

RewriteEngine On
RewriteRule !\.(gif|jpe?g|png|css|js|html)$ index.php

DirectoryIndex index.php

----

Now, what I understand, it should do:
1. Deny every access (worked fine!)
2. Allow access for "index.php" and the graphic files (did not work)
3. Rewrite all non-graphic files to index.php
4. Set index.php as Directory the index file

Now, my questions:
1. Will apache stop after the first "FileMatch"-block and thus deny every access? (This is, what seemed to happen to me) or will it evaluate all blocks?
2. Will the RewriteRule be parsed before the FileMatching?
3. How should this work with a URL like bla.com/dir/index.php/gallery/some/more/parameter? The second FileMatch will not allow this.

So... do i have a strange configured webserver or why does this .htaccess not work for me at all?

Marco
http://www.hyperroad-design.com

K259

Sunday 18 January 2004 4:01:39 am

Hi Marco!

I've experienced the same "thing" while testing, and a lot of other ppl. have also had much headache about this file. Maybe the eZ-crew can do some testing here, give us feedback and state if the file is working, if we are doing something wrong, or if it's a conflict somewhere...

Marco Zinn

Sunday 18 January 2004 4:17:59 am

Hi,
after some more testing, my assumption:
The error, that i experienced was NOT the 403, but a 500, which says, that my server may be misconfigured.
So, i guess, the provided file needs some "Override Priviliges" in the Virtual Host, that is used to Host the domain.
Cause the .htaccess file wants to alter some settings for this directory and in order to do this, it needs the rights from "it's" Virtual Host and I guess, that this is not true for me.
I commented out all lines (-> Server worked) and removed the comments individually to find out, which lines causes the error.... To no avail: As soon as one line got into effect, i got the "500" error.
We need some Apache Expert ;)

Marco
http://www.hyperroad-design.com

Lazaro Ferreira

Sunday 18 January 2004 7:05:17 am

Hi,

Are you using Apache 2.x ?

There is a known problem with Apache 2.x, EZP .htaccess file, and URL setups (No virtual host in Apache httpd.conf)

You have to add the directive below, to use URLs that includes 'index.php' like in www.yourdomain.com/index.php/home

AcceptPathInfo On
---------------------------

Lazaro
http://www.mzbusiness.com

Marco Zinn

Monday 19 January 2004 10:02:15 am

No, I'm using apache 1.3.
But your info will probably solve 5 other threads in the forums ;)

Marco
http://www.hyperroad-design.com

Jose Velez

Thursday 18 November 2004 7:13:35 pm

Did anyone ever figure this out? I am having this problem too.

eZ debug

Timing: Jan 18 2025 16:12:20
Script start
Timing: Jan 18 2025 16:12:20
Module start 'content'
Timing: Jan 18 2025 16:12:20
Module end 'content'
Timing: Jan 18 2025 16:12:21
Script end

Main resources:

Total runtime0.1351 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 587.7109180.8359
Module start 'content' 0.00620.0050 768.5469101.8828
Module end 'content' 0.01120.1239 870.4297537.2500
Script end 0.1350  1,407.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00322.4025200.0002
Check MTime0.00130.9514200.0001
Mysql Total
Database connection0.00050.358210.0005
Mysqli_queries0.094669.98761410.0007
Looping result0.00120.89971390.0000
Template Total0.123691.510.1236
Template load0.00070.487810.0007
Template processing0.122990.986910.1229
Override
Cache load0.00050.345710.0005
Sytem overhead
Fetch class attribute can translate value0.00050.401810.0005
XML
Image XML parsing0.00030.214110.0003
General
dbfile0.00241.7979200.0001
String conversion0.00000.002830.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0005 secs