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

Shipping Based on Number of Items (1998) Search Title Question (1998) OH MY GOD! (1998) [Webcat 2]Next (1997) [WebDNA] Lookup inside grep?... (2011) [sendmail] v. [writefile] (2000) Incorrect Store Totals (2005) PCS Emailer's role ? (1997) Re:2nd WebCatalog2 Feature Request (1996) Force a search at the default.tmpl page? (1997) problems with 2 tags (1997) WebCatalog for Postcards ? (1997) Firesite and [referrer] atg broke (1997) How To question on setting up downloads (1997) [WebDNA] Which is more efficient? New db or add to existing db (2013) [format xs] freeze (1997) ooops...WebCatalog [FoundItems] Problem - LONG - (1997) Omnibase file manipulation utility (1999) Hosting (2000) customizing the color of user's pages (1997)