Forum Moderators: phranque

Message Too Old, No Replies

LocationMatch with mod rewrite

         

scuffell

10:00 am on Oct 13, 2009 (gmt 0)

10+ Year Member



Hi there,

I'm having a few little issues with a combination of mod_rewrite and LocationMatch, and I was wondering if anyone could help me out.

I am running Wordpress MU, and have implemented single sign on capability with NTLM. This is all well and good, and it works great.

However, I do not want to have to authenticate to grab an RSS feed. The URLs for RSS feeds on my server are [myserver.intra...] I know I can add the "Satisfy any" option in the LocationMatch or FilesMatch directive, and that should do the trick:

<LocationMatch "feed">
Satisfy any
</LocationMatch>

However, mod_rewrite rewrites /myblog/feed to /index.php, so the LocationMatch doesn't match. I can't change the LocationMatch to index.php because this would then fail to authenticate for other things, as well as RSS feeds.

Is there a way of forcing LocationMatch to be processed before the rewrite rules, or can anyone think of another way of implementing this?

Thanks for your help.

jdMorgan

12:22 pm on Oct 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



LocationMatch uses regular-expressions pattern-matching, so it may be a simple matter of using a regex pattern instead of a simple string, and using the local 'OR' in the pattern to match either '/myblog/feed' or '/myblog/index.php'.

Since this code allows bypassing authentication, I suggest anchoring the pattern and matching as much of the entire URL-path as possible.... "^/myblog/(feed/¦index\.php$)"

Replace the broken pipe "¦" character with a solid pipe before use; Posting on this forum modifies the pipe characters.

Jim