Re: [WebDNA] OT: How is this being done? Curious. - CLEAN URL's
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 103602
interpreted = N
texte = William DeVaul wrote:> When I view source, I see the source the same as any page. In this> case, there is a default page returned when nothing is specified.> This is becoming a Web 2.0 type standard and a RESTful type practice.> It is also SEO friendly.> > Under WebDNA this would be possible by, for example, making Apache> route /[talent_name]/ to a file like index.htm using a proxypass or> similar. I'm not sure that a WebDNA script could handle it directly> because the cgi for WebDNA routes to specific files in response to a> request.> > If I'm wrong about that, someone please let us know.> > BillGood topic for a Friday. :-) Btw, I've heard of this type of URL styleas "Clean URLS" or "ModRewrite style URLS"... or even "Search Engine Friendly URL's"..I can say/reveal a little about this rightnow. WebDNA on the *nix side is an apache mod just like mod_rewrite andthe PC API works in a similar fashion..so the possibility is there that we could mimic those features and thusmake this kind of feature available cross-platform. It would most likely incorporate WebDNA's preParsescript. I *will* tell you that this feature was one of the first featurerequests put on the priorities list... being that I've been pushingfor this for several years before the acquisition. ;-) However, thereare some tricky aspects to this that we are (and will be) looking into, so I can't guarantee anything right now. ;-)For *nix systems.. you all have this feature fairly easily usingmod_rewrite right now.. just rewrite all requests for a domain or domains to a .tpl file then parses via domain (if applicable) and [thisURL].Below is some code that I just now wrote that would be ideal (to me) to be able to use in WebDNA's preparse script eventually.. however, you coulduse this as a reference now using mod_rewrite I suppose. Justredirect all URL's.. either using .htaccess or the httpd.conf or vhostsconf files to this second template (the domain specific stuff below isnot needed if only one domain is to be pointed to the parsing script) (note:I use a lot of functions mostly to strip out white space, but it helpsa bit with modularization):-----file: included in WebDNA's PreParse script to take the place of ModRewrite----------[function name=CALL_DOMAIN] [return][ListMIMEHeaders name=host&exact=F][url][value][/url][/ListMIMEHeaders][/return][/function][function name=f_LoadPage][if "[fileinfo file=^[iDomain].inc][exists][/fileinfo]"="T"][then][return][include file=^[iDomain].inc&iThisURL=[url][iThisURL][/url]][/return] [/then] [else][return]
[/return][/else][/if][/function][f_LoadPage iDomain=[CALL_DOMAIN]&iThisURL=[thisURL]]--------------------------------------------------------------Then in your globals directory...---file: [iDomain].inc, or a specific ("ParseURL.tpl") file to be referred to by ModRewrite--------[!] File PATH [/!][function name=f_filePath][!] *DomainRoot - May have to turn on absolute paths or use relative paths depending * [/!][text]tDomainRoot=/var/www/blah/blah/[/text][listwords words=[params_string]&delimiters=/] [showif [index]=1] [if "[fileinfo file=[tDomainRoot][word].inc][exists][/fileinfo]"="T"][then] [text]tTheFilePath=[tDomainRoot][word].html[/text] [/then][else][/else][/if] [/showif][/listwords][retrun][tTheFilePath][/return][/function][!] PARAMS to pass into the file [/!][function name=f_fileParams] [text]tParams=[/text] [listwords words=[params_string]&delimiters=/] [switch value=[index]] [case value=2] [switch value=[word]] [case value=someMode] [text]tParams=[tParams]&iMode=blah1[/text] [/case] [case value=someOtheraction] [text]tParams=[tParams]iMode=blah1[/text] [/case] [/switch] [/case] [case value=3] [switch value=[word]] [case value=someAction] [text]tParams=[tParams]&iAction=blah1[/text] [/case] [case value=someOtheraction] [text]tParams=[tParams]&iAction=blah1[/text] [/case] [/switch] [/case] [case value=etc..] [/case] [/switch] [/listwords] [return][tParams][/return][/function][!] ** Load the Page ** [/!][hideif [url][fileinfo file=[f_filePath] [iThisURL]][exists][/fileinfo][/url]!T] [include file=[f_filePath [iThisURL]][f_fileParams [iThisURL]]][/hideif][!] ** Error ** [/!][showif [url][fileinfo file=[f_filePath] [iThisURL]][exists][/fileinfo][/url]!T] [include file=/var/www/blah/blah/custom404page.html][/showif]---------------------------Again, the code above is untested and written quickly just to beused as a reference. There are, as always, more than 1 one to skin the cat.Donovan (back to work) :-)-- Donovan BrookeWebDNA Software Corporationhttp://www.webdna.us**[Square Bracket Utopia]**
Associated Messages, from the most recent to the oldest:
|
- Re: [WebDNA] OT: How is this being done? Curious. - CLEAN URL's (Donovan Brooke 2009)
|
William DeVaul wrote:> When I view source, I see the source the same as any page. In this> case, there is a default page returned when nothing is specified.> This is becoming a Web 2.0 type standard and a RESTful type practice.> It is also SEO friendly.> > Under WebDNA this would be possible by, for example, making Apache> route /[talent_name]/ to a file like index.htm using a proxypass or> similar. I'm not sure that a WebDNA script could handle it directly> because the cgi for WebDNA routes to specific files in response to a> request.> > If I'm wrong about that, someone please let us know.> > BillGood topic for a Friday. :-) Btw, I've heard of this type of URL styleas "Clean URLS" or "ModRewrite style URLS"... or even "Search Engine Friendly URL's"..I can say/reveal a little about this rightnow. WebDNA on the *nix side is an apache mod just like mod_rewrite andthe PC API works in a similar fashion..so the possibility is there that we could mimic those features and thusmake this kind of feature available cross-platform. It would most likely incorporate WebDNA's preParsescript. I *will* tell you that this feature was one of the first featurerequests put on the priorities list... being that I've been pushingfor this for several years before the acquisition. ;-) However, thereare some tricky aspects to this that we are (and will be) looking into, so I can't guarantee anything right now. ;-)For *nix systems.. you all have this feature fairly easily usingmod_rewrite right now.. just rewrite all requests for a domain or domains to a .tpl file then parses via domain (if applicable) and [thisurl].Below is some code that I just now wrote that would be ideal (to me) to be able to use in WebDNA's preparse script eventually.. however, you coulduse this as a reference now using mod_rewrite I suppose. Justredirect all URL's.. either using .htaccess or the httpd.conf or vhostsconf files to this second template (the domain specific stuff below isnot needed if only one domain is to be pointed to the parsing script) (note:I use a lot of functions mostly to strip out white space, but it helpsa bit with modularization):-----file: included in WebDNA's PreParse script to take the place of ModRewrite----------[function name=CALL_DOMAIN] [return][ListMIMEHeaders name=host&exact=F][url][value][/url][/ListMIMEHeaders][/return][/function][function name=f_LoadPage][if "[fileinfo file=^[iDomain].inc][exists][/fileinfo]"="T"][then][return][include file=^[iDomain].inc&iThisURL=[url][iThisURL][/url]][/return] [/then] [else][return][/return][/else][/if][/function][f_LoadPage iDomain=[CALL_DOMAIN]&iThisURL=[thisurl]]--------------------------------------------------------------Then in your globals directory...---file: [iDomain].inc, or a specific ("ParseURL.tpl") file to be referred to by ModRewrite--------[!] File PATH [/!][function name=f_filePath][!] *DomainRoot - May have to turn on absolute paths or use relative paths depending * [/!][text]tDomainRoot=/var/www/blah/blah/[/text][listwords words=[params_string]&delimiters=/] [showif [index]=1] [if "[fileinfo file=[tDomainRoot][word].inc][exists][/fileinfo]"="T"][then] [text]tTheFilePath=[tDomainRoot][word].html[/text] [/then][else][/else][/if] [/showif][/listwords][retrun][tTheFilePath][/return][/function][!] PARAMS to pass into the file [/!][function name=f_fileParams] [text]tParams=[/text] [listwords words=[params_string]&delimiters=/] [switch value=[index]] [case value=2] [switch value=[word]] [case value=someMode] [text]tParams=[tParams]&iMode=blah1[/text] [/case] [case value=someOtheraction] [text]tParams=[tParams]iMode=blah1[/text] [/case] [/switch] [/case] [case value=3] [switch value=[word]] [case value=someAction] [text]tParams=[tParams]&iAction=blah1[/text] [/case] [case value=someOtheraction] [text]tParams=[tParams]&iAction=blah1[/text] [/case] [/switch] [/case] [case value=etc..] [/case] [/switch] [/listwords] [return][tParams][/return][/function][!] ** Load the Page ** [/!][hideif [url][fileinfo file=[f_filePath] [iThisURL]][exists][/fileinfo][/url]!T] [include file=[f_filePath [iThisURL]][f_fileParams [iThisURL]]][/hideif][!] ** Error ** [/!][showif [url][fileinfo file=[f_filePath] [iThisURL]][exists][/fileinfo][/url]!T] [include file=/var/www/blah/blah/custom404page.html][/showif]---------------------------Again, the code above is untested and written quickly just to beused as a reference. There are, as always, more than 1 one to skin the cat.Donovan (back to work) :-)-- Donovan BrookeWebDNA Software Corporationhttp://www.webdna.us**[Square Bracket Utopia]**
Donovan Brooke
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:
Google Web Accelerator (2005)
access denied problem (1997)
Help! WebCat2 bug (1997)
Search Help Please (1998)
WebCat2 Append problem (B14Macacgi) (1997)
To brighten your day... (2006)
Difficult Alternating Problem (2001)
default value from Lookup (was Grant, please help me) (1997)
Multiple Purchase (2002)
Fedora Core 3 and WebDNA (2005)
EditPlus 2 WebDNA cliptext (2002)
Moment of Thanks (1997)
WebCatalog for guestbook ? (1997)
Bulletin Board (1998)
Date stamp and purging (1998)
WC1.6 to WC2 date formatting -FIXED! (1997)
pc (1997)
Daze to Dates (1998)
Digest Format (2003)
unable to launch acgi in WebCat (1997)