Re: URL problem

This WebDNA talk-list message is from

2007


It keeps the original formatting.
numero = 68410
interpreted = N
texte = Does parse.tmpl live at the root level of the destination site? On Feb 4, 2007, at 5:18 PM, Tom Duke wrote: > 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=%{REQUEST_URI} [L] > > parser.tmpl > --------------- > [!] > [/!][!] > > ------------------------------------ > ### Parse search parameters from the request string ### > [/!][listwords > words=[url][requestedurl][/url]&delimiters=/.][text]param[index]= > [word][ > /text][/listwords][!] > > ------------------------------------ > ### Match 'param1' to the 'areaid' variable ### > [/!][switch value=[param1]][!] > [/!][case value=][text]areaid=[lookup > db=data/db_content/ > coreNav.db&value=index&lookinfield=FAREA&returnfield= > RID¬found=dud1][/text][/case][!] > [/!][case value=[raw][param1][/raw]][text]areaid=[lookup > db=data/db_content/ > coreNav.db&value=index&lookinfield=FAREA&returnfield= > RID¬found=dud2][/text][/case][!] > [/!][default][text]areaid=[lookup > db=data/db_content/coreNav.db&value=[param1] > &lookinfield=FAREA&returnfie > ld=RID¬found=dud3][/text][/default][!] > [/!][/switch][!] > > ------------------------------------ > ### Match 'param2' to the 'section' variable ### > [/!][switch value=[param2]][!] > [/!][case value=][text]section=index[/text][/case][!] > [/!][case > value=[raw][param2][/raw]][text]section=index[/text][/case][!] > [/!][case value=html][text]section=index[/text][/case][!] > [/!][case value=tmpl][text]section=index[/text][/case][!] > [/!][default][text]section=[param2][/text][/default][!] > [/!][/switch][!] > > ------------------------------------ > ### Call in the 'index.inc' includes file ### > [/!][include > file=common/includes/site_index.inc&areaid=[areaid]§ion=[section]] > > > > ------------------------------------------------------------- > 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 digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- 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:

    
Does parse.tmpl live at the root level of the destination site? On Feb 4, 2007, at 5:18 PM, Tom Duke wrote: > 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=%{REQUEST_URI} [L] > > parser.tmpl > --------------- > [!] > [/!][!] > > ------------------------------------ > ### Parse search parameters from the request string ### > [/!][listwords > words=[url][requestedurl][/url]&delimiters=/.][text]param[index]= > [word][ > /text][/listwords][!] > > ------------------------------------ > ### Match 'param1' to the 'areaid' variable ### > [/!][switch value=[param1]][!] > [/!][case value=][text]areaid=[lookup > db=data/db_content/ > coreNav.db&value=index&lookinfield=FAREA&returnfield= > RID¬found=dud1][/text][/case][!] > [/!][case value=[raw][param1][/raw]][text]areaid=[lookup > db=data/db_content/ > coreNav.db&value=index&lookinfield=FAREA&returnfield= > RID¬found=dud2][/text][/case][!] > [/!][default][text]areaid=[lookup > db=data/db_content/coreNav.db&value=[param1] > &lookinfield=FAREA&returnfie > ld=RID¬found=dud3][/text][/default][!] > [/!][/switch][!] > > ------------------------------------ > ### Match 'param2' to the 'section' variable ### > [/!][switch value=[param2]][!] > [/!][case value=][text]section=index[/text][/case][!] > [/!][case > value=[raw][param2][/raw]][text]section=index[/text][/case][!] > [/!][case value=html][text]section=index[/text][/case][!] > [/!][case value=tmpl][text]section=index[/text][/case][!] > [/!][default][text]section=[param2][/text][/default][!] > [/!][/switch][!] > > ------------------------------------ > ### Call in the 'index.inc' includes file ### > [/!][include > file=common/includes/site_index.inc&areaid=[areaid]§ion=[section]] > > > > ------------------------------------------------------------- > 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 digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- 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/ Pat McCormick

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:

WebCatalog for guestbook ? (1997) database editor add field, etc. (2005) Cancel Subscription (1996) Kaaaaahhhhhhhnnnnnnn! (1997) Bug (feature) in v6 listfiles shows hidden files ... (2004) MySQL & WebDNA on Windows (2006) Re(2): Small Bug: ErrorLog.txt/[FORMVARIABLES]/[ORDERFILE] (1998) using showpage and showcart commands (1996) RE: WebCat: Access denied, but why? (1997) Not really WebCat (1997) PCS Frames (1997) Showif Question (2001) URGENT - CPU usage OSXS (2001) Upgrading old WebCat Database Files (1997) oops private message leaked into talk list (1997) random images (1997) CC Merchant suggestions?? (1997) emailer (1997) Trouble with [fileinfo] - update (2004) can WC render sites out? (1997)