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

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 102569
interpreted = N
texte = --Apple-Mail-218-293398662 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-218-293398662 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]|]
&n= bsp;[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>]
=

= --Apple-Mail-218-293398662-- Associated Messages, from the most recent to the oldest:

    
--Apple-Mail-218-293398662 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-218-293398662 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]|]
&n= bsp;[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>]
=

= --Apple-Mail-218-293398662-- 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:

Bad "from" address in sendmail (2004) Problems with [Applescript] (1997) Incrementing a number (1998) Reversed words (1997) math a various prices (1997) problems with WebCat-Plugin (1997) Re:quit command on NT (1997) WebCatalog and Filemaker (1996) Wanted: Broader string manipulation functions (1997) Listfiles on network with NT (2000) Client-side Image Maps and WebCat? (1998) Where is f2? (1997) OT: IP addres checking (2003) Re1000001: Setting up shop (1997) extending webcatalog (1997) Only charge card when product shipped ? (1997) WebDNA as FastCGI or CGI (2008) Whats wrong with this code? (1998) Separate server for jpg/gif files (1998) WC 2.0 frames feature (1997)