Re: [users@httpd] Re: mod_rewrite Scenario Assistance

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

 



Joshua -

I have one quick follow-up question, if you don't mind.  I've
implemented the rules as shown below and have been watching the logs
and I notice that the /landingpage.cfm pattern is always being engaged
for /landingpage.cfm (even though I'm never calling that page
directly).  Does the redirection itself cause the rewrite rules to be
executed?

Here is what I have:

    RewriteEngine On
    RewriteLog  /var/log/httpd/rewrite_log
    RewriteLogLevel 3

    RewriteRule ^/bfg                  -                       [L]
    RewriteRule ^/se                   -                       [L]
    RewriteRule ^/mod/modules/foo      -                       [L]
    RewriteRule ^/landingpage.cfm      -                       [L]
    RewriteRule ^/(.*)
/landingpage.cfm?uri=%{REQUEST_URI}     [QSA,PT]

Thanks again.

On 7/2/06, Rob Wilkerson <r.d.wilkerson@xxxxxxxxx> wrote:
Sorry, by CGI variables, I meant the webserver variables.  Stored in
the CGI scope by ColdFusion and in the SERVER[] scope in PHP, if that
helps.  Variables like SCRIPT_NAME, HTTP_REFERER, etc.

I tried your sample code against several use cases and it does
everything our current module does and more.  I still have to test the
webserver variables to know whether I have to pass the URL in the
query string, but I think that should be a formality.

Thanks again for all of your help.  Without it, this effort would have
taken significantly longer than it did.  I appreciate that.

On 7/1/06, Joshua Slive <joshua@xxxxxxxx> wrote:
> On 7/1/06, Rob Wilkerson <r.d.wilkerson@xxxxxxxxx> wrote:
> > 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.
>
> If by "CGI variables" you mean the query string, then my example did,
> in fact, change them.  But if you leave off the "?$1" they should be
> left unchanged.  (Your script may need to look in
> REDIRECT_QUERY_STRING.  That's why I suggest dumping all the variables
> to see what is available.)
>
> >
> > 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.
>
> I thought you mean langing page as in a page that you redirect
> off-site visitors to when they first arrive.  You are correct it is
> not needed in the scenario you describe.  NC stands for No Case,
> meaning the test is case-insensitive.  Check the documentation for
> RewriteCond.
>
> 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



--

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



[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