Re: Using .htaccess and ModRewrite - (was [OT] CSS and SSI

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 57592
interpreted = N
texte = Thanks... Well I now have my hands full ;-) I think I will have to do some re-organising of some links before attempting to implement this on our site. Maybe a little test site with 2 variables in the url first me thinks.... Cheers Alan on 4/28/04 9:00 PM, Tom Duke at tduke@technofutures.ie wrote: > Alan, > > Here is the code we are using. Some of the 'parser.tmpl' code is specific to > our setup but the code to split the URL should be of some use to you. > > - Tom > > > > > .htaccess file > ------------------------------------------------------------ > > RewriteEngine On > RewriteRule ^admin/.*$ - [L] > RewriteRule ^data/.*$ - [L] > RewriteRule ^common/.*$ - [L] > RewriteRule ^download/.*$ - [L] > RewriteCond %{REQUEST_URI} !parser\.tmpl > RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|css) > RewriteRule ^(.+)$ /parser.tmpl?requestedurl=%{REQUEST_URI} [L] > > > parser.tmpl > ------------------------------------------------------------ > > [!] > [/!][!] > > ------------------------------------ > ### Parse search parameters from the request string ### > [/!][text]parsestring=[middle > startafter=[middlestart]&endbefore=][requestedurl][/middle][/text][!] > [/!][listwords > words=[parsestring]&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&no > tfound=dud1][/text][/case][!] > [/!][case value=[raw][param1][/raw]][text]areaid=[lookup > db=data/db_content/coreNav.db&value=index&lookinfield=FAREA&returnfield=RID&no > tfound=dud2][/text][/case][!] > [/!][default][text]areaid=[lookup > db=data/db_content/coreNav.db&value=[param1]&lookinfield=FAREA&returnfield=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/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 > > 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:

    
  1. Re: Using .htaccess and ModRewrite - (was [OT] CSS and SSI ( Alan White 2004)
  2. Using .htaccess and ModRewrite - (was [OT] CSS and SSI books) ( "Tom Duke" 2004)
Thanks... Well I now have my hands full ;-) I think I will have to do some re-organising of some links before attempting to implement this on our site. Maybe a little test site with 2 variables in the url first me thinks.... Cheers Alan on 4/28/04 9:00 PM, Tom Duke at tduke@technofutures.ie wrote: > Alan, > > Here is the code we are using. Some of the 'parser.tmpl' code is specific to > our setup but the code to split the URL should be of some use to you. > > - Tom > > > > > .htaccess file > ------------------------------------------------------------ > > RewriteEngine On > RewriteRule ^admin/.*$ - [L] > RewriteRule ^data/.*$ - [L] > RewriteRule ^common/.*$ - [L] > RewriteRule ^download/.*$ - [L] > RewriteCond %{REQUEST_URI} !parser\.tmpl > RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|css) > RewriteRule ^(.+)$ /parser.tmpl?requestedurl=%{REQUEST_URI} [L] > > > parser.tmpl > ------------------------------------------------------------ > > [!] > [/!][!] > > ------------------------------------ > ### Parse search parameters from the request string ### > [/!][text]parsestring=[middle > startafter=[middlestart]&endbefore=][requestedurl][/middle][/text][!] > [/!][listwords > words=[parsestring]&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&no > tfound=dud1][/text][/case][!] > [/!][case value=[raw][param1][/raw]][text]areaid=[lookup > db=data/db_content/coreNav.db&value=index&lookinfield=FAREA&returnfield=RID&no > tfound=dud2][/text][/case][!] > [/!][default][text]areaid=[lookup > db=data/db_content/coreNav.db&value=[param1]&lookinfield=FAREA&returnfield=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/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 > > 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/ Alan White

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:

[OT] Test (2003) WC 2.0 frames feature (1997) Car Database (2002) WebCatalog NT beta 18 problem (1997) Associative lookup style? + bit more (1997) Displaying raw values (long) (1998) Saving Text Areas with Orders (1997) Re[2]: WebCatalog + Linux + ODBC + Oracle ! ? (2000) Searching using numbers (1998) [platform] tag? (1998) LOG IN LOG OUT (1997) [protect] on NT? (1997) Referrer field to header field conversion (1997) [WebDNA] listfunctions, listscopes, listincluded? (2011) why why why (2004) Execute Applescript (1997) PCS Frames (1997) shipcost (1997) [WebDNA] IP Address to country (2008) Separate SSL Server (1997)