Question

Is there a way to apply a rule to a single directory and not its subdirectories without using .htaccess files? I want /var/www/html to order by the Date desc. However, in the subdirectories, I don't want this rule applied.

Right now, I have IndexOrderDefault Descending Date within the /var/www/html Directory tag.

Was it helpful?

Solution

For users who encounter this problem: See https://issues.apache.org/bugzilla/show_bug.cgi?id=49809 (Apache bug 49809). $ is not recognized by Apache as an end of line anchor for some inexplicable reason.

OTHER TIPS

You can use the DirectoryMatch directive to match that directory (and only that directory) exactly:

<DirectoryMatch "^/www/var/html$">
    IndexOrderDefault Descending Date
</DirectoryMatch>

It uses regular expressions to match the directory path. See http://httpd.apache.org/docs/2.0/mod/core.html#directorymatch for more info.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top