[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:

Further on formula.db failure to calculate shipCost (1997) [append] vs. [appendfile] delta + question? (1997) Can you identify the [body]? (1999) If Else Statement... (2004) OK, here goes... (1997) TCPSend / Netscape Server 4.1 (2003) Fun with Dates - finally resolved but.... (1997) dates and hex formatting (1997) OT: Email Spam a bit of Hell (2004) using showpage and showcart commands (1996) RequiredFields template (1997) Using Applescript to process WebCatalog functions (1998) Redirect from Domain1 to Domain2 (2004) [OT] XML data to tab delimited database (2003) Sort Order on a page search (1997) unixODBC and WebCatalog (2001) Running _every_ page through WebCat ? (1997) Payment Processors (2005) PCS Emailer's role ? (1997) A quickie question (1997)