.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.

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