Re: [WebDNA] set HTTP-Status Code from webdna

This WebDNA talk-list message is from

2016


It keeps the original formatting.
numero = 112672
interpreted = N
texte = 255 This is a multi-part message in MIME format. --------------060302040702010608080003 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable curious how to determine...non google/bing/yahoo bots and other=20 attempting to crawl/copy the entire site? On 3/24/2016 9:28 AM, Brian Burton wrote: > Noah, > > Similar to you, and wanting to use pretty URLs I built something=20 > similar, but did it a different way. > _All_ page requests are caught by a url-rewrite rule and get sent to=20 > dispatch.tpl > Dispatch.tpl has hundreds of rules that decide what page to show, and=20 > uses includes to do it. > (this keeps everything in-house to webdna so i don=E2=80=99t have to go= =20 > mucking about in webdna here, and apache there, and linux somewhere=20 > else, and etc=E2=80=A6) > > Three special circumstances came up that needed special code to send=20 > out proper HTTP status codes: > > temporarily moved code on a redirect) =E2=80=94> > [function name=3D301public] > [text]eol=3D[unurl]%0D%0A[/unurl][/text] > [returnraw]HTTP/1.1 301 Moved Permanently[eol]Location:=20 > http://www.example.com[link][eol][eol][/returnraw] > [/function] > > crawl/copy the entire site=E2=80=94> > [function name=3D404hard] > [text]eol=3D[unurl]%0D%0A[/unurl][/text] > [returnraw]HTTP/1.0 404 Not Found[eol]Status: 404 Not=20 > Found[eol]Content-type:=20 > text/html[eol][eol][eol][eol]

404 Not=20 > Found

[eol]The page that you have requested ([thisurl]) could not=20 > be found.[eol][eol][/returnraw] > [/function] > > > [function name=3D404soft] > [text]eol=3D[unurl]%0D%0A[/unurl][/text] > [returnraw]HTTP/1.0 404 Not Found[eol]Status: 404 Not=20 > Found[eol]Content-type: text/html[eol][eol][include=20 > file=3D/404pretty.tpl][/returnraw] > [/function] > > Hope this helps > -Brian B. Burton > > >> On Mar 24, 2016, at 10:53 AM, Noah Valley > > wrote: >> >> Hi everybody, >> >> The Question First: Is it possible to set the HTTP-Status Codes with=20 >> webdna? >> >> Explanation why we need to do this: >> I=E2=80=99ve been working with webdna for 3 years now but our our busi= ness is=20 >> on webdna since the 90ies; using it for a web-cms and custom=20 >> web-solutions. We now host about 150 websites on lighttpd. >> We newly started using "url-rewrite" so we can have custom urls for=20 >> our websites. It directs calls from domain.com/cms/something=20 >> to domain.com/cms.dna?url=3Dsomethin= g=20 >> . >> Example: Visitor goes to domain.com/cms/aboutus=20 >> and it shows domain.com/=20 >> cms.dna=20 >> ?url=3Daboutus -> webdna=20 >> finds =E2=80=9Eaboutus" in DB and shows correct site >> Problem: Visitor goes to domain.com/cms/somethingwrong=20 >> and it shows domain.com/=20 >> cms.dna=20 >> ?url=3Dsomethingwrong -> = webdna=20 >> does not find somethingwrong in DB and shows an error-page but the=20 >> HTTP status remains 200! >> >> Is it possible to set the HTTP-Status Code with webdna? In this case=20 >> to 404 in other cases to something else. Or how would you solve that=20 >> problem? >> >> Thanks! >> >> Noah Valley >> mac&web gmbh >> S=C3=A4ntistrasse 13 >> 8200 schaffhausen >> switzerland >> >> Tel +41 52 620 30 60 >> Fax +41 52 620 30 61 >> valley@mac-web.ch >> www.mac-web.ch >> >> --------------------------------------------------------- This=20 >> message is sent to you because you are subscribed to the mailing list=20 >> . To unsubscribe, E-mail to: archives:=20 >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:=20 >> support@webdna.us > --=20 Jym Duane - CTO - Purpose Media Creating Your Success Story Marketing : Television - Internet -Print Phone: (877) 443-1323 Email: jym@purposemedia.com Web: www.purposemedia.com Oregon - www.GuideToOregon.com PO Box 1725, Jacksonville, OR 97530 California - www.OrangeCounty.net PO Box 2025, Capistrano Beach, CA 92624 --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us --------------060302040702010608080003 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable curious how to determine...non google/bing/yahoo bots and other attempting to crawl/copy the entire site?



On 3/24/2016 9:28 AM, Brian Burton wrote:
Noah,=C2=A0

Similar to you, and wanting to use pretty URLs I built something similar, but did it a different way.
_All_ page requests are caught by a url-rewrite rul= e and get sent to dispatch.tpl
Dispatch.tpl has hundreds of rules that decide what page to show, and uses includes to do it.=C2=A0
(this keeps everything in-house to webdna so i don=E2= =80=99t have to go mucking about in webdna here, and apache there, and linux somewhere else, and etc=E2=80=A6)=C2=A0

Three special circumstances came up that needed special code to send out proper HTTP status codes:

<!=E2=80=94 for page URLS that have permanently = moved (webdna sends out a 302 temporarily moved code on a redirect) =E2=80=94>
[function name=3D301public]
[text]eol=3D[unurl]%0D%0A[/unurl][/text]
[returnraw]HTTP/1.1 301 Moved Permanently[eol]Location: http://www.example.com[link][eol][eol][/returnraw]=
[/function]

<!=E2=80=94 I send this to non google/bing/yah= oo bots and other attempting to crawl/copy the entire site=E2=80=94>=
[function name=3D404hard]
[text]eol=3D[unurl]%0D%0A[/unurl][/text]
[returnraw]HTTP/1.0 404 Not Found[eol]Status: 404 Not Found[eol]Content-type: text/html[eol][eol]<html>[eol]<body>[eol]<h1>= 404 Not Found</h1>[eol]The page that you have requested ([thisurl]) could not be found.[eol]</body>[eol]</html>[/returnraw]
[/function]

<!=E2=80=94 and finally a pretty 404 page for = humans =E2=80=94>
[function name=3D404soft]
[text]eol=3D[unurl]%0D%0A[/unurl][/text]
[returnraw]HTTP/1.0 404 Not Found[eol]Status: 404 Not Found[eol]Content-type: text/html[eol][eol][include file=3D/404pretty.tpl][/returnraw]
[/function]

Hope this helps
-Brian B. Burton


On Mar 24, 2016, at 10:53 AM, Noah Valley <= ;valley@mac-web.ch> wrote:

Hi everybody,

The Question First: Is it possible to set the HTTP-Status Codes with webdna?

Explanation why we need to do this:
I=E2=80=99ve been working with webdna for= 3 years now but our our business is on webdna since the 90ies; using it for a web-cms and custom web-solutions. We now host about 150 websites on lighttpd.
We newly started using "url-rewrite" so w= e can have custom urls for our websites. It directs calls from d= omain.com/cms/something=C2=A0to domain.com/cms.dna?url=3Dsomething.=C2= =A0
Example: Visitor goes to=C2=A0domain= ..com/cms/aboutus=C2=A0and it shows domain.com/cms.dna?url=3Daboutus=C2=A0-> webdn= a finds =E2=80=9Eaboutus" in DB and shows correct site
Problem: Visitor goes to=C2=A0domain.com/cms/somethingwrong=C2=A0and it shows=C2=A0domain.com/cms.dna?url=3Dsomethingwrong=C2=A0->= ;=C2=A0webdna does not find somethingwrong=C2=A0in DB and shows an error-page but the HTTP status remains 200!

Is it possible to set the HTTP-Status Cod= e with webdna? In this case to 404 in other cases to something else. Or how would you solve that problem?

Thanks!

Noah Valley
mac&web gmbh
S=C3=A4ntistrasse 13
8200 schaffhausen
switzerland

Tel +41 52 620 30 60
Fax +41 52 620 30 61
= valley@mac-web.ch www= ..mac-web.ch

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us<= /a> Bug Reporting: support@= webdna.us


--=20Jym Duane - CTO - Purpose MediaCreating Your Success StoryMarketing : Television - Internet -PrintPhone: (877) 443-1323  =20Email: jym@purposemedia.com  =20Web: www.purposemedia.comOregon - www.GuideToOregon.comPO Box 1725,  Jacksonville, OR 97530California - www.OrangeCounty.netPO Box 2025,  Capistrano Beach, CA 92624 
--------------060302040702010608080003-- . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] set HTTP-Status Code from webdna (Brian Burton 2016)
  2. Re: [WebDNA] set HTTP-Status Code from webdna (Noah Valley 2016)
  3. Re: [BULK] Re: [WebDNA] set HTTP-Status Code from webdna (Tom Duke 2016)
  4. Re: [BULK] Re: [WebDNA] set HTTP-Status Code from webdna (Brian Burton 2016)
  5. Re: [BULK] Re: [WebDNA] set HTTP-Status Code from webdna (christophe.billiottet@webdna.us 2016)
  6. Re: [WebDNA] set HTTP-Status Code from webdna (Brian Burton 2016)
  7. [BULK] Re: [WebDNA] set HTTP-Status Code from webdna (Brian Burton 2016)
  8. Re: [WebDNA] set HTTP-Status Code from webdna (Jym Duane 2016)
  9. Re: [WebDNA] set HTTP-Status Code from webdna (Noah Valley 2016)
  10. Re: [WebDNA] set HTTP-Status Code from webdna (Brian Burton 2016)
  11. [WebDNA] set HTTP-Status Code from webdna (Noah Valley 2016)
255 This is a multi-part message in MIME format. --------------060302040702010608080003 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable curious how to determine...non google/bing/yahoo bots and other=20 attempting to crawl/copy the entire site? On 3/24/2016 9:28 AM, Brian Burton wrote: > Noah, > > Similar to you, and wanting to use pretty URLs I built something=20 > similar, but did it a different way. > _All_ page requests are caught by a url-rewrite rule and get sent to=20 > dispatch.tpl > Dispatch.tpl has hundreds of rules that decide what page to show, and=20 > uses includes to do it. > (this keeps everything in-house to webdna so i don=E2=80=99t have to go= =20 > mucking about in webdna here, and apache there, and linux somewhere=20 > else, and etc=E2=80=A6) > > Three special circumstances came up that needed special code to send=20 > out proper HTTP status codes: > > temporarily moved code on a redirect) =E2=80=94> > [function name=3D301public] > [text]eol=3D[unurl]%0D%0A[/unurl][/text] > [returnraw]HTTP/1.1 301 Moved Permanently[eol]Location:=20 > http://www.example.com[link][eol][eol][/returnraw] > [/function] > > crawl/copy the entire site=E2=80=94> > [function name=3D404hard] > [text]eol=3D[unurl]%0D%0A[/unurl][/text] > [returnraw]HTTP/1.0 404 Not Found[eol]Status: 404 Not=20 > Found[eol]Content-type:=20 > text/html[eol][eol][eol][eol]

404 Not=20 > Found

[eol]The page that you have requested ([thisurl]) could not=20 > be found.[eol][eol][/returnraw] > [/function] > > > [function name=3D404soft] > [text]eol=3D[unurl]%0D%0A[/unurl][/text] > [returnraw]HTTP/1.0 404 Not Found[eol]Status: 404 Not=20 > Found[eol]Content-type: text/html[eol][eol][include=20 > file=3D/404pretty.tpl][/returnraw] > [/function] > > Hope this helps > -Brian B. Burton > > >> On Mar 24, 2016, at 10:53 AM, Noah Valley > > wrote: >> >> Hi everybody, >> >> The Question First: Is it possible to set the HTTP-Status Codes with=20 >> webdna? >> >> Explanation why we need to do this: >> I=E2=80=99ve been working with webdna for 3 years now but our our busi= ness is=20 >> on webdna since the 90ies; using it for a web-cms and custom=20 >> web-solutions. We now host about 150 websites on lighttpd. >> We newly started using "url-rewrite" so we can have custom urls for=20 >> our websites. It directs calls from domain.com/cms/something=20 >> to domain.com/cms.dna?url=3Dsomethin= g=20 >> . >> Example: Visitor goes to domain.com/cms/aboutus=20 >> and it shows domain.com/=20 >> cms.dna=20 >> ?url=3Daboutus -> webdna=20 >> finds =E2=80=9Eaboutus" in DB and shows correct site >> Problem: Visitor goes to domain.com/cms/somethingwrong=20 >> and it shows domain.com/=20 >> cms.dna=20 >> ?url=3Dsomethingwrong -> = webdna=20 >> does not find somethingwrong in DB and shows an error-page but the=20 >> HTTP status remains 200! >> >> Is it possible to set the HTTP-Status Code with webdna? In this case=20 >> to 404 in other cases to something else. Or how would you solve that=20 >> problem? >> >> Thanks! >> >> Noah Valley >> mac&web gmbh >> S=C3=A4ntistrasse 13 >> 8200 schaffhausen >> switzerland >> >> Tel +41 52 620 30 60 >> Fax +41 52 620 30 61 >> valley@mac-web.ch >> www.mac-web.ch >> >> --------------------------------------------------------- This=20 >> message is sent to you because you are subscribed to the mailing list=20 >> . To unsubscribe, E-mail to: archives:=20 >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:=20 >> support@webdna.us > --=20 Jym Duane - CTO - Purpose Media Creating Your Success Story Marketing : Television - Internet -Print Phone: (877) 443-1323 Email: jym@purposemedia.com Web: www.purposemedia.com Oregon - www.GuideToOregon.com PO Box 1725, Jacksonville, OR 97530 California - www.OrangeCounty.net PO Box 2025, Capistrano Beach, CA 92624 --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us --------------060302040702010608080003 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable curious how to determine...non google/bing/yahoo bots and other attempting to crawl/copy the entire site?



On 3/24/2016 9:28 AM, Brian Burton wrote:
Noah,=C2=A0

Similar to you, and wanting to use pretty URLs I built something similar, but did it a different way.
_All_ page requests are caught by a url-rewrite rul= e and get sent to dispatch.tpl
Dispatch.tpl has hundreds of rules that decide what page to show, and uses includes to do it.=C2=A0
(this keeps everything in-house to webdna so i don=E2= =80=99t have to go mucking about in webdna here, and apache there, and linux somewhere else, and etc=E2=80=A6)=C2=A0

Three special circumstances came up that needed special code to send out proper HTTP status codes:

<!=E2=80=94 for page URLS that have permanently = moved (webdna sends out a 302 temporarily moved code on a redirect) =E2=80=94>
[function name=3D301public]
[text]eol=3D[unurl]%0D%0A[/unurl][/text]
[returnraw]HTTP/1.1 301 Moved Permanently[eol]Location: http://www.example.com[link][eol][eol][/returnraw]=
[/function]

<!=E2=80=94 I send this to non google/bing/yah= oo bots and other attempting to crawl/copy the entire site=E2=80=94>=
[function name=3D404hard]
[text]eol=3D[unurl]%0D%0A[/unurl][/text]
[returnraw]HTTP/1.0 404 Not Found[eol]Status: 404 Not Found[eol]Content-type: text/html[eol][eol]<html>[eol]<body>[eol]<h1>= 404 Not Found</h1>[eol]The page that you have requested ([thisurl]) could not be found.[eol]</body>[eol]</html>[/returnraw]
[/function]

<!=E2=80=94 and finally a pretty 404 page for = humans =E2=80=94>
[function name=3D404soft]
[text]eol=3D[unurl]%0D%0A[/unurl][/text]
[returnraw]HTTP/1.0 404 Not Found[eol]Status: 404 Not Found[eol]Content-type: text/html[eol][eol][include file=3D/404pretty.tpl][/returnraw]
[/function]

Hope this helps
-Brian B. Burton


On Mar 24, 2016, at 10:53 AM, Noah Valley <= ;valley@mac-web.ch> wrote:

Hi everybody,

The Question First: Is it possible to set the HTTP-Status Codes with webdna?

Explanation why we need to do this:
I=E2=80=99ve been working with webdna for= 3 years now but our our business is on webdna since the 90ies; using it for a web-cms and custom web-solutions. We now host about 150 websites on lighttpd.
We newly started using "url-rewrite" so w= e can have custom urls for our websites. It directs calls from d= omain.com/cms/something=C2=A0to domain.com/cms.dna?url=3Dsomething.=C2= =A0
Example: Visitor goes to=C2=A0domain= ..com/cms/aboutus=C2=A0and it shows domain.com/cms.dna?url=3Daboutus=C2=A0-> webdn= a finds =E2=80=9Eaboutus" in DB and shows correct site
Problem: Visitor goes to=C2=A0domain.com/cms/somethingwrong=C2=A0and it shows=C2=A0domain.com/cms.dna?url=3Dsomethingwrong=C2=A0->= ;=C2=A0webdna does not find somethingwrong=C2=A0in DB and shows an error-page but the HTTP status remains 200!

Is it possible to set the HTTP-Status Cod= e with webdna? In this case to 404 in other cases to something else. Or how would you solve that problem?

Thanks!

Noah Valley
mac&web gmbh
S=C3=A4ntistrasse 13
8200 schaffhausen
switzerland

Tel +41 52 620 30 60
Fax +41 52 620 30 61
= valley@mac-web.ch www= ..mac-web.ch

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us<= /a> Bug Reporting: support@= webdna.us


--=20Jym Duane - CTO - Purpose MediaCreating Your Success StoryMarketing : Television - Internet -PrintPhone: (877) 443-1323  =20Email: jym@purposemedia.com  =20Web: www.purposemedia.comOregon - www.GuideToOregon.comPO Box 1725,  Jacksonville, OR 97530California - www.OrangeCounty.netPO Box 2025,  Capistrano Beach, CA 92624 
--------------060302040702010608080003-- . Jym Duane

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:

America Online Issues (1998) Entry pages (was: WebCatalog MAJOR drawback) (1998) Grep search not working (2002) [WebDNA] Is WebDNA slowing things up - please try these URL's (2013) [WebDNA] WebDNA 8.6 announced - New features (2018) WebCat editing, SiteGuard & SiteEdit (1997) foreign languages, email, webcat (1998) This [search] worked before update to 4.5.1 (2003) NY taxRates.db? (1997) Generating Report Totals (1997) [WebDNA] High-profile WebDNA sites? (2008) Quickie question on the email templates (1997) GoLive CyberStudio 1.0.1 (1997) Next (1997) searchable list archive (1997) RE: Clearing orders and database help! (1997) [WebDNA] IIS 6.1 Win 7 (2013) GuestBook example (1997) Help name our technology! (1997) [WebDNA] users.db (2009)