Thanks, Joshua. I'm glad I asked. The ways I was planning to attempt would've been *far* more complex. I had no idea it would be that simple. If I understand you correctly...mod_rewrite does *not* modify the CGI variables? If not, then I probably don't have to pass anything along at all. That, of course, would be ideal. One last question (for now), if you don't mind: can you explain your last paragraph? For me, local referrers still need redirection. This is for a CMS that stores pages as data. The "landing page" is actually a rendering engine that compiles and caches the data as a physical file. I was trying to simplify the example scenario. Even so, I'd like to understand what your final condition is doing. Specifically, the NC portion. I believe the rest is checking the referring URL for anything that is not within the site I'm accessing and redirecting only then. Thanks again. That really was an eye-opener for me. On 7/1/06, Joshua Slive <joshua@xxxxxxxx> wrote:
On 7/1/06, Rob Wilkerson <r.d.wilkerson@xxxxxxxxx> wrote: > I've gotten some great feedback on this question, but would still > really like to see some kind of example code to help me get started. > I suspect I'll need to use RewriteBase and RewriteCond in addition to > RewriteRule, but I'm not feeling all that confident in my, ahem, > analysis. > > In my case, for any given virtual host, I need everything to go to > landingpage.php *except* for requests to anything in /se or anything > in /bfg (both are aliases - Alias /se /opt/product/version/se). Can > anyone throw together some simple directives to show me how I might > accomplish this? I also need to pass along the original URL, but I > imagine I can work that out if I understand the first part well > enough. The rewrite itself is where I think I'm most lost. You don't need RewriteBase unless you are using .htaccess files. You can also avoid RewriteConf for a simple scenario like this: RewriteEngine On RewriteRule ^/bfg - [L] RewriteRule ^/se - [L] RewriteRule ^/landingpage.php - [L] RewriteRule ^/(.*) /landingpage.php?$1 The first three rules are rewrite a path back to itself and then end processing. The last RewriteRule does the real work. I passed the original path in the query string, but it could also be passed as PATH_INFO or just fished out of the environment. (Try dumping the entire environment in you landingpage.php and you should be able to pick out the original path someplace.) Use the RewriteLog to debug. I suspect you also have another requirement that you didn't mention: the internal redirect to the landing page should happen only for requests that do not have local referers. If so, you need to add RewriteCond %{HTTP_REFERER} !^http://mysite.com/ [NC] before the final RewriteRule. Joshua. Joshua. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
-- Rob Wilkerson --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx