Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: HTTP Silent Redirect

From: hallvard::ystad::babelserver::org at: 23-Sep-2008 8:33

Hi Vonja, A silent redirect actually isn't a redirect. It's simply Apache serving some other document for the script. So if you have two files: 1.r and 2.r and when you get a request for 1.r, and you'd like to redirect silently to 2.r, you'll just have to serve 2.r (and not say anything about it to the browser). There is no way for the browser (at least not for the browsers I know) to show another URI than the actual one in the address bar. Here's a sample (not tested!): replace incoming-url "1.r" "2.r" print read next find incoming-url "/" # remove leading slash first .. So you actually don't mess with the headers. If you prefer to do the rewrite in a script made for that intent only, Apache will let you do the rewrite processing with a rebol script: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap The apache directive would look something like this: RewriteMap to2-map prg:/path/to/map.1to2.r Hope this helps, HY Dixit vonja-sbcglobal.net (07.46 23.09.2008):