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

[WebDNA] Reserved variables (2009) update on wn searching (1997) How to Sort Summ data ? (1997) Ok here is a question? (1997) Error Log.db --however (1997) Merging databases (1997) Please.. copies of Digest for 7/29 and 7/30? (1997) WebDNA Solutions ... sorry! (1997) problems with 2 tags (1997) Cancel Subscription (1996) FTP FOLDER PERMISSIONS (2004) RE: what characters are replaced for tab and CR? (1998) 'does not contain' operator needed ... (1997) HELP WITH DATES (1997) Possible Bug in 2.0b15.acgi (1997) Search anomaly aaarrgghh! (2000) Snake Bites (1997) Not really WebCat (1997) Database Fields (1997) Emailer setup (1997)