Re: urls
This WebDNA talk-list message is from 2005
It keeps the original formatting.
numero = 63559
interpreted = N
texte = Kalin,I use mod_rewrite and WebDNA to create search engine safe urls on most =of my sites - The Irish Labour site being the biggest =(http://www.labour.ie).The .htaccess file I use is:-RewriteEngine OnRewriteRule ^excludedfolders/.*$ - [L]RewriteCond %{REQUEST_URI} !parser\.tmplRewriteCond %{REQUEST_URI} !\.(gif|jpg|png|css|ico)RewriteRule ^(.+)$ /parser.tmpl?requestedurl=3D%{REQUEST_URI} [L]Include a line replacing 'excludedfolders' for each directory you do not =want rewritten.On the 'parser.tmpl' page I strip out each search parameter from the URL =and assign a variable to it 'param1', 'param2' etc, and then I determine =which includes file to use. If no match is found for the URL I serve up =an error page which returns a 404 error using the raw command and =mimeheaders. My code is below though obviously you would have to change =it for your circumstances.Might be of some use.Regards- Tom[!][/!][!]------------------------------------### Parse search parameters from the request string ###[/!][text]parsestring=3D[middle =startafter=3D[middlestart]&endbefore=3D][requestedurl][/middle][/text][!]=[/!][listwords =words=3D[parsestring]&delimiters=3D/.][text]param[index]=3D[word][/text][=/listwords][!]------------------------------------### Determine if 'param1' relates to the specific db ###[/!][showif [url][lookup =db=3Ddata/db_specific/specific.db&value=3D[param1]&lookinfield=3DDIRECTUR=L&returnfield=3DRID¬found=3Ddud][/url]!dud][text]incfile=3Dspecific[/t=ext][/showif][!]------------------------------------### Determine if 'param1' relates to the content db ###[/!][showif [url][lookup =db=3Ddata/db_content/coreNav.db&value=3D[param1]&lookinfield=3DFAREA&retu=rnfield=3DRID¬found=3Ddud][/url]!dud][text]incfile=3Dcontent[/text][/s=howif][!]------------------------------------### Override if 'param1' relates to youth, women or lawyers ###[/!][showif =[url][param1][/url]=3Dyouth][text]incfile=3Dyouth[/text][/showif][!][/!][showif =[url][param1][/url]=3Dwomen][text]incfile=3Dwomen[/text][/showif][!][/!][showif =[url][param1][/url]=3Dlawyers][text]incfile=3Dlawyers[/text][/showif][!]------------------------------------### Determine which 'index' includes files ###[/!][switch value=3D[incfile]][!][/!][case value=3Dyouth][include =file=3Dcommon/includes/youth_index.inc][/case][!][/!][case value=3Dwomen][include =file=3Dcommon/includes/women_index.inc][/case][!][/!][case value=3Dlawyers][include =file=3Dcommon/includes/lawyers_index.inc][/case][!][/!][case value=3Dpeople][include =file=3Dcommon/includes/people_index.inc][/case][!][/!][case value=3Dplaces][include =file=3Dcommon/includes/places_index.inc][/case][!][/!][case value=3Dcontent][include =file=3Dcommon/includes/site_index.inc][/case][!][/!][default][include file=3Dcommon/includes/error.inc][/default][!][/!][/switch]-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Kalin,I use mod_rewrite and WebDNA to create search engine safe urls on most =of my sites - The Irish Labour site being the biggest =(http://www.labour.ie).The .htaccess file I use is:-RewriteEngine OnRewriteRule ^excludedfolders/.*$ - [L]RewriteCond %{REQUEST_URI} !parser\.tmplRewriteCond %{REQUEST_URI} !\.(gif|jpg|png|css|ico)RewriteRule ^(.+)$ /parser.tmpl?requestedurl=3D%{REQUEST_URI} [L]Include a line replacing 'excludedfolders' for each directory you do not =want rewritten.On the 'parser.tmpl' page I strip out each search parameter from the URL =and assign a variable to it 'param1', 'param2' etc, and then I determine =which includes file to use. If no match is found for the URL I serve up =an error page which returns a 404 error using the raw command and =mimeheaders. My code is below though obviously you would have to change =it for your circumstances.Might be of some use.Regards- Tom[!][/!][!]------------------------------------### Parse search parameters from the request string ###[/!][text]parsestring=3D[middle =startafter=3D[middlestart]&endbefore=3D][requestedurl][/middle][/text][!]=[/!][listwords =words=3D[parsestring]&delimiters=3D/.][text]param[index]=3D[word][/text][=/listwords][!]------------------------------------### Determine if 'param1' relates to the specific db ###[/!][showif [url][lookup =db=3Ddata/db_specific/specific.db&value=3D[param1]&lookinfield=3DDIRECTUR=L&returnfield=3DRID¬found=3Ddud][/url]!dud][text]incfile=3Dspecific[/t=ext][/showif][!]------------------------------------### Determine if 'param1' relates to the content db ###[/!][showif [url][lookup =db=3Ddata/db_content/coreNav.db&value=3D[param1]&lookinfield=3DFAREA&retu=rnfield=3DRID¬found=3Ddud][/url]!dud][text]incfile=3Dcontent[/text][/s=howif][!]------------------------------------### Override if 'param1' relates to youth, women or lawyers ###[/!][showif =[url][param1][/url]=3Dyouth][text]incfile=3Dyouth[/text][/showif][!][/!][showif =[url][param1][/url]=3Dwomen][text]incfile=3Dwomen[/text][/showif][!][/!][showif =[url][param1][/url]=3Dlawyers][text]incfile=3Dlawyers[/text][/showif][!]------------------------------------### Determine which 'index' includes files ###[/!][switch value=3D[incfile]][!][/!][case value=3Dyouth][include =file=3Dcommon/includes/youth_index.inc][/case][!][/!][case value=3Dwomen][include =file=3Dcommon/includes/women_index.inc][/case][!][/!][case value=3Dlawyers][include =file=3Dcommon/includes/lawyers_index.inc][/case][!][/!][case value=3Dpeople][include =file=3Dcommon/includes/people_index.inc][/case][!][/!][case value=3Dplaces][include =file=3Dcommon/includes/places_index.inc][/case][!][/!][case value=3Dcontent][include =file=3Dcommon/includes/site_index.inc][/case][!][/!][default][include file=3Dcommon/includes/error.inc][/default][!][/!][/switch]-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
"Tom Duke"
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] XSS and getting rid of HTML codes (2018)
RequiredFields template (1997)
WebCat2 Append problem (B14Macacgi) (1997)
showcart is slow (1998)
Size limit for tmpl editor ? (1997)
[WebDNA] MD5 Hash issue (2009)
Help! (1996)
question: search return in order (1997)
RequiredFields template (1997)
Multiple catalog databases and showcart (1997)
Support ?? (1997)
Searchable list archive (1997)
Sorting problem (2002)
Off Topic: Frames Killer? (1998)
SM: Max connections exceeded clarification please (2002)
Webcatalog error, Plug-in for Webstar (1996)
WebCat & Liststar (1997)
Mirroring WebCat Servers (2001)
Purchased cart being overwritten - still !?? (1997)
WebCat2b13MacPlugin - [math][date][/math] problem (1997)