I'm not exactly sure what your rules mean... I usually have a RewriteCond that goes before a rewriteRule, so if you wanted to only redirect the cfm pages to landingpage.cfm, you would do
RewriteCond %{REQUEST_URI} cfm$ [NC] RewriteRule ^/(.*)$ /landingpage.cfm?uri=$1 [L,QSA] You might need to play around a bit with flags and regexes, but I think this is what you're looking for. Don't forget you can also use -f to test if the file exists before doing a rewrite. You can use a similar rule for non cfm pages and just have those either pull directly or use a PT flag on them to do the appropriate rewriting. Russ > -----Original Message----- > From: Rob Wilkerson [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 05, 2006 3:56 PM > To: CF-Talk > Subject: ColdFusion, Apache & mod_rewrite > > I'm running into a problem that Pete Freitag has blogged on > (http://www.petefreitag.com/item/22.cfm), but his solution isn't > optimal for me so I'm wondering whether anyone in the audience has an > answer. > > I have a site in which nearly any URI - even ones that don't exist - > need to redirect to a landing page. I currently have a custom built > Apache module that handles the redirection, but keeping up with that > is just an extra hassle if I can get mod_rewrite to do what the module > does. So far, I'm close - very close since I can get it to work - but > not quite where I'd like to be. I'm hoping someone can help me get > there. > > I have the following RewriteRules: > RewriteEngine On > RewriteRule ^/cfide - [L] > RewriteRule ^/CFIDE - [L] > RewriteRule ^/bfg - [L] > RewriteRule ^/se - [L] > RewriteRule ^/mod/modules/foo - [L] > RewriteRule ^/landingpage.cfm - [L] > RewriteRule ^/(.*) /landingpage.cfm [QSA] > > These work beautifully if the redirected URI - ^/(.*) - ends with .cfm > (e.g. /ack/foo/blah.cfm). It doesn't work so beautifully if the > redirected URI is something like /ack/foo/blah/ugh.htm or /ack/foo/. > When it bombs it simply displays the file content as though it were > text. > > If I add the PT (pass-through) flag to the last rule then it works > great, but the CGI.SCRIPT_NAME variable contains /landingpage.cfm > rather than the URI of the original request (e.g. /ack/foo/). If I > use that flag, I can get to a point of functional redirection using > the rules below. For reasons of cleanliness and simplicity, though, > I'd prefer not to use that flag and have the CGI variables carry the > original URI. > > Working rules: > RewriteEngine On > RewriteRule ^/folder1 - [L] > RewriteRule ^/folder2 - [L] > RewriteRule ^/f3/f4/foo - [L] > RewriteRule ^/landingpage.cfm - [L] > RewriteRule ^/(.*) > /landingpage.cfm?uri=%{REQUEST_URI} [QSA,PT] > > Has anyone else seen this issue and successfully found a way around it? > > Any assistance or insight would be appreciated. Thanks. > > -- > > Rob Wilkerson > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:245441 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54