httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Johnson <...@indietorrent.org>
Subject [users@httpd] Using Alias (mod_alias) with .htaccess files
Date Tue, 19 Feb 2013 16:24:57 GMT
Hi, everyone,

I'm using mod_alias to map URLs to directories that are outside of
Apache's DocumentRoot. However, it seems that .htaccess files are being
ignored in these directories.


File: my-customizations.conf (included in httpd.conf)
##################################################################
Alias /project-one "C:/Users/Ben/Documents/Projects/one-svn/trunk"
Alias /project-two "C:/Users/Ben/Documents/Projects/two-svn/trunk"

<DirectoryMatch
"^C:/Users/Ben/Documents/Projects/.*-svn/(trunk|branches|tags)/">
    Options +Indexes +FollowSymLinks

    AllowOverride All

    Include conf/auth.conf
</DirectoryMatch>
##################################################################



File: "C:/Users/Ben/Documents/Projects/one-svn/trunk/public/.htaccess"
##################################################################
RewriteEngine on
Options All

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
##################################################################


The first block seems to have the intended effect. I'm able to access
each project at the designated alias, and my authentication rules are
applied.

This block is definitely effective, because if I remove it, I receive
"access denied", as expected.

However, it appears that the .htaccess file is being ignored entirely.
If I cram a bunch of syntactically-invalid junk into the .htaccess file,
no error occurs. The directory index file (index.php in this case) is
loaded without errors.

I see the following excerpt among mod_info's output:

In file: C:/Program Files/apache/conf/my-customizations.conf
   3: <DirectoryMatch
"^C:/Users/Ben/Documents/Projects/.*-svn/(trunk|branches|tags)/">
   16:   Options +Indexes +FollowSymLinks
   23:   AllowOverride All
     : </DirectoryMatch>

Given that "AllowOverride All" is present, shouldn't the .htaccess file
be honored?

This post seems to describe the same issue:
http://stackoverflow.com/questions/8376590/htaccess-is-ignored-when-using-an-aliased-uri
.

Unfortunately, the "answer" doesn't address the fact that the .htaccess
file isn't loaded at all, in which case the mod_rewrite peculiarities
are irrelevant.

I'm using Apache 2.4 on Win32.

Any help is very much appreciated.

Thank you,

-Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message