Re: URL problem

This WebDNA talk-list message is from

2007


It keeps the original formatting.
numero = 68408
interpreted = N
texte = Pat, I do this using mod-rewrite and a .htaccess file that rewrites all requests to to WebDNA page that then parses the URL and performs searches and includes etc. Code is below, you'll obviously have to customise it to your setup. One other thing - I also have to have a blank 'index.html' file in the root of the site for this to work - could never figure out why. - Tom ..htaccess ----------------------- RewriteEngine On RewriteRule ^admin/.*$ - [L] RewriteRule ^common/.*$ - [L] RewriteRule ^data/.*$ - [L] RewriteRule ^download/.*$ - [L] RewriteRule ^imglibrary/.*$ - [L] RewriteRule ^filelibrary/.*$ - [L] RewriteRule ^upload/.*$ - [L] RewriteCond %{REQUEST_URI} !parser\.tmpl RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|css|ico) RewriteRule ^(.+)$ /parser.tmpl?requestedurl=3D%{REQUEST_URI} [L] parser.tmpl --------------- [!] [/!][!] =20 ------------------------------------ ### Parse search parameters from the request string ### [/!][listwords words=3D[url][requestedurl][/url]&delimiters=3D/.][text]param[index]=3D[w= ord][ /text][/listwords][!] =20 ------------------------------------ ### Match 'param1' to the 'areaid' variable ### [/!][switch value=3D[param1]][!] [/!][case value=3D][text]areaid=3D[lookup db=3Ddata/db_content/coreNav.db&value=3Dindex&lookinfield=3DFAREA&returnf= ield=3D RID¬found=3Ddud1][/text][/case][!] [/!][case value=3D[raw][param1][/raw]][text]areaid=3D[lookup db=3Ddata/db_content/coreNav.db&value=3Dindex&lookinfield=3DFAREA&returnf= ield=3D RID¬found=3Ddud2][/text][/case][!] [/!][default][text]areaid=3D[lookup db=3Ddata/db_content/coreNav.db&value=3D[param1]&lookinfield=3DFAREA&retu= rnfie ld=3DRID¬found=3Ddud3][/text][/default][!] [/!][/switch][!] =20 ------------------------------------ ### Match 'param2' to the 'section' variable ### [/!][switch value=3D[param2]][!] [/!][case value=3D][text]section=3Dindex[/text][/case][!] [/!][case value=3D[raw][param2][/raw]][text]section=3Dindex[/text][/case][!] [/!][case value=3Dhtml][text]section=3Dindex[/text][/case][!] [/!][case value=3Dtmpl][text]section=3Dindex[/text][/case][!] [/!][default][text]section=3D[param2][/text][/default][!] [/!][/switch][!] =20 ------------------------------------ ### Call in the 'index.inc' includes file ### [/!][include file=3Dcommon/includes/site_index.inc&areaid=3D[areaid]§ion=3D[sectio= n]] =20 ------------------------------------------------------------- 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:

    
  1. Re: URL problem ( Pat McCormick 2007)
  2. Re: URL problem ( Donovan Brooke 2007)
  3. Re: URL problem ( "Dan Strong" 2007)
  4. Re: URL problem ( Pat McCormick 2007)
  5. Re: URL problem ( "Tom Duke" 2007)
  6. Re: URL problem ( Pat McCormick 2007)
  7. Re: URL problem ( Stuart Tremain 2007)
  8. Re: URL problem ( Pat McCormick 2007)
  9. Re: URL problem ( Pat McCormick 2007)
  10. Re: URL problem ( Pat McCormick 2007)
  11. Re: URL problem ( "Tom Duke" 2007)
  12. Re: URL problem ( Stuart Tremain 2007)
  13. URL problem ( Pat McCormick 2007)
  14. Strange variable in url problem... (Jimmi Kristensen 2001)
Pat, I do this using mod-rewrite and a .htaccess file that rewrites all requests to to WebDNA page that then parses the URL and performs searches and includes etc. Code is below, you'll obviously have to customise it to your setup. One other thing - I also have to have a blank 'index.html' file in the root of the site for this to work - could never figure out why. - Tom ..htaccess ----------------------- RewriteEngine On RewriteRule ^admin/.*$ - [L] RewriteRule ^common/.*$ - [L] RewriteRule ^data/.*$ - [L] RewriteRule ^download/.*$ - [L] RewriteRule ^imglibrary/.*$ - [L] RewriteRule ^filelibrary/.*$ - [L] RewriteRule ^upload/.*$ - [L] RewriteCond %{REQUEST_URI} !parser\.tmpl RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|css|ico) RewriteRule ^(.+)$ /parser.tmpl?requestedurl=3D%{REQUEST_URI} [L] parser.tmpl --------------- [!] [/!][!] =20 ------------------------------------ ### Parse search parameters from the request string ### [/!][listwords words=3D[url][requestedurl][/url]&delimiters=3D/.][text]param[index]=3D[w= ord][ /text][/listwords][!] =20 ------------------------------------ ### Match 'param1' to the 'areaid' variable ### [/!][switch value=3D[param1]][!] [/!][case value=3D][text]areaid=3D[lookup db=3Ddata/db_content/coreNav.db&value=3Dindex&lookinfield=3DFAREA&returnf= ield=3D RID¬found=3Ddud1][/text][/case][!] [/!][case value=3D[raw][param1][/raw]][text]areaid=3D[lookup db=3Ddata/db_content/coreNav.db&value=3Dindex&lookinfield=3DFAREA&returnf= ield=3D RID¬found=3Ddud2][/text][/case][!] [/!][default][text]areaid=3D[lookup db=3Ddata/db_content/coreNav.db&value=3D[param1]&lookinfield=3DFAREA&retu= rnfie ld=3DRID¬found=3Ddud3][/text][/default][!] [/!][/switch][!] =20 ------------------------------------ ### Match 'param2' to the 'section' variable ### [/!][switch value=3D[param2]][!] [/!][case value=3D][text]section=3Dindex[/text][/case][!] [/!][case value=3D[raw][param2][/raw]][text]section=3Dindex[/text][/case][!] [/!][case value=3Dhtml][text]section=3Dindex[/text][/case][!] [/!][case value=3Dtmpl][text]section=3Dindex[/text][/case][!] [/!][default][text]section=3D[param2][/text][/default][!] [/!][/switch][!] =20 ------------------------------------ ### Call in the 'index.inc' includes file ### [/!][include file=3Dcommon/includes/site_index.inc&areaid=3D[areaid]§ion=3D[sectio= n]] =20 ------------------------------------------------------------- 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-Talk Digests (1997) creating a ShipCosts database (1997) [hideif] (1998) suffix mapping for NT? (1997) gateway application timeouts (1998) Associative lookup style? + bit more (1997) WebCatalog for guestbook ? (1997) There's a bug in the math context ... (1997) Proposed FormVariables hierarchy (2000) F3 crashing server (1997) WebCat2 - storing unformatted date data? (1997) Pithy questions on webcommerce & siteedit (1997) Extracting undeliverable email addresses (2003) WebCat2: multiple currency support (1997) RequiredFields template (1997) Fwd: search engine friendly URLS (Mac) (1998) WebCat2b13 Command Reference Doc error (1997) Passing info in [Addlineitem] (1997) carriage returns in data (1997) LetterRip and WebCat (1998)