Using Alias (mod_alias) with .htaccess files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux