> That worked pefectly. Only add thing is that the URL didn't
> have the page=X part. But get this - it was there in
> cgi.query_string.

You can also get to it through the URL scope; this will also include the
original query string information too.

If you would rather it did a full client-side redirect you can do
something like the following:

  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)?$ /404.cfm?page=%{REQUEST_URI} [R=302,QSA,L]

Please note that the location of the 404.cfm page is no longer relative
(the added '/' in front of it) -- URL redirecting doesn't work so good
without this.

Another thing to be aware of is that because of the Apache deals with
directory names that don't have a trailing slash (e.g. /my/path gets
internally rewritten to /my/path/ before processing) you also need to
have a directory check in there.  This is true in general, not just
while doing external redirects as above:

  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)?$ 404.cfm?page=%{REQUEST_URI} [QSA,L]

> I'll blog this later today if you don't mind. 

Sure, no problem.

Tim.

--
-------------------------------------------------------
 TB: http://tim.bla.ir/  Tech: http://tech.badpen.com/
-------------------------------------------------------
     RAWNET LTD - independent digital media agency
     "We are big, we are funny and we are clever!"
                http://www.rawnet.com/
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential.  If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
-------------------------------------------------------


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to