[BULK] Re: [WebDNA] How to code a 301 redirect

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 102558
interpreted = N
texte = --Apple-Mail-164--110346472 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Donovan, I can't get a 301 to work. If I change the header to a 302 Found, it works perfect. Thoughts? WebDNA 6.0a || MacOS X 10.4.11 On Jul 21, 2008, at 1:04 PM, Donovan Brooke wrote: > Regarding the 301.. the newer Function context as well > as the newer pre-parse script allow us to make just > about any kind of WebDNA context that we want. Here is > the 301 redirect using those features. > > > (Put this in your page, or better yet, in your pre-parse include file) > > [!] ** 301 Redirect ** [/!] > [function name=301redirect] > > [hideif ||[url][raw][redirect_url][/raw][/url]|^|[url][redirect_url] > [/url]|] > [text]CRLF=[unurl]%0D%0A[/unurl][/text] > [text]result=HTTP/1.1 301 Moved Permanently > Location: [redirect_url][/text] > [/hideif] > > [return][returnraw][result][CRLF][CRLF][/returnraw][/return] > [/function] > > > Then, to implement a quick 301, call the function with: > > [301redirect redirect_url=] --Apple-Mail-164--110346472 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Donovan,

I = can't get a 301 to work. If I change the header to a 302 Found, it works = perfect. Thoughts?

WebDNA 6.0a  || =  MacOS X = 10.4.11



On Jul 21, = 2008, at 1:04 PM, Donovan Brooke wrote:

Regarding the 301.. the newer Function context as = well
as the newer pre-parse script allow us to make just
about any = kind of WebDNA context that we want. Here is
the 301 redirect using = those features.


(Put this in your page, or better yet, in = your pre-parse include file)

[!] ** 301 Redirect ** = [/!]
[function name=3D301redirect]

[hideif = ||[url][raw][redirect_url][/raw][/url]|^|[url][redirect_url][/url]|]
=  [text]CRLF=3D[unurl]%0D%0A[/unurl][/text]
[text]result=3DHTTP/1.1= 301 Moved Permanently
Location: = [redirect_url][/text]
[/hideif]

[return][returnraw][result][CRLF= ][CRLF][/returnraw][/return]
[/function]


Then, to = implement a quick 301, call the function with:

[301redirect = redirect_url=3D<http://yoururl>]
<= div apple-content-edited=3D"true">

= --Apple-Mail-164--110346472-- Associated Messages, from the most recent to the oldest:

    
--Apple-Mail-164--110346472 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Donovan, I can't get a 301 to work. If I change the header to a 302 Found, it works perfect. Thoughts? WebDNA 6.0a || MacOS X 10.4.11 On Jul 21, 2008, at 1:04 PM, Donovan Brooke wrote: > Regarding the 301.. the newer Function context as well > as the newer pre-parse script allow us to make just > about any kind of WebDNA context that we want. Here is > the 301 redirect using those features. > > > (Put this in your page, or better yet, in your pre-parse include file) > > [!] ** 301 Redirect ** [/!] > [function name=301redirect] > > [hideif ||[url][raw][redirect_url][/raw][/url]|^|[url][redirect_url] > [/url]|] > [text]CRLF=[unurl]%0D%0A[/unurl][/text] > [text]result=HTTP/1.1 301 Moved Permanently > Location: [redirect_url][/text] > [/hideif] > > [return][returnraw][result][CRLF][CRLF][/returnraw][/return] > [/function] > > > Then, to implement a quick 301, call the function with: > > [301redirect redirect_url=] --Apple-Mail-164--110346472 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Donovan,

I = can't get a 301 to work. If I change the header to a 302 Found, it works = perfect. Thoughts?

WebDNA 6.0a  || =  MacOS X = 10.4.11



On Jul 21, = 2008, at 1:04 PM, Donovan Brooke wrote:

Regarding the 301.. the newer Function context as = well
as the newer pre-parse script allow us to make just
about any = kind of WebDNA context that we want. Here is
the 301 redirect using = those features.


(Put this in your page, or better yet, in = your pre-parse include file)

[!] ** 301 Redirect ** = [/!]
[function name=3D301redirect]

[hideif = ||[url][raw][redirect_url][/raw][/url]|^|[url][redirect_url][/url]|]
=  [text]CRLF=3D[unurl]%0D%0A[/unurl][/text]
[text]result=3DHTTP/1.1= 301 Moved Permanently
Location: = [redirect_url][/text]
[/hideif]

[return][returnraw][result][CRLF= ][CRLF][/returnraw][/return]
[/function]


Then, to = implement a quick 301, call the function with:

[301redirect = redirect_url=3D<http://yoururl>]
<= div apple-content-edited=3D"true">

= --Apple-Mail-164--110346472-- Clint Davis

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

plugin-acgi, different results (1997) Deleting Orders (1997) Re[2]: 2nd WebCatalog2 Feature Request (1996) [OT] (waaaay OT) (2004) [format xs] freeze (1997) Grepping to remove text & code (2004) RE: Missing contexts on NT (1997) Browser Resolution (1999) [OT] Internet connection problem (2003) Scientific notation to number, a solution? (2001) Kill the webcat process (2000) Slow NT mail. (2000) Searching multiple fields from one form field (1997) Appendfile memory usage (redux) (2003) Is Typhoon 4 or Typhoon Pro a product? (2000) Nested search (1997) Big Databases (1997) WC2b15 File Corruption (1997) Bug In Admin Templates (2003) Email...Thanks (1997)