SlideShare une entreprise Scribd logo
1  sur  165
Télécharger pour lire hors ligne
URL Design
– Methods to Use Friendly URLs
URL Design
– Methods to Use Friendly URLs
              by Johan Sölve
       Montania System AB, Sweden
           www.montania.se
URL Design
– Methods to Use Friendly URLs
              by Johan Sölve
       Montania System AB, Sweden
           www.montania.se

              • Software and consulting company
              • Business administration solutions
                for small- and medium-sized
                business
URL Design




             2 of 41
URL Design




             2 of 41
URL Design




             2 of 41
URL Design




             2 of 41
URL Design




             2 of 41
A URL is not a Filename




                          3 of 41
A URL is not a Filename
• Servertotechnology file us think that a URL
                     makes
  maps a physical




                                                3 of 41
A URL is not a Filename
• Servertotechnology file us think that a URL
                     makes
  maps a physical
• This is not how things are intended




                                                3 of 41
A URL is not a Filename
• Servertotechnology file us think that a URL
                     makes
  maps a physical
• This is not how things are intended
  • A URL is a reference to a resource




                                                3 of 41
A URL is not a Filename
• Servertotechnology file us think that a URL
                     makes
  maps a physical
• This is not how things are intended
  • A URL is a reference to a resource
  • Disconnect the URL from the server’s file system




                                                 3 of 41
A URL is not a Filename
• Servertotechnology file us think that a URL
                     makes
  maps a physical
• This is not how things are intended
  • A URL is a reference to a resource
  • Disconnect the URL from the server’s file system
  • Design URLs!



                                                 3 of 41
A URL is not a Filename
• Servertotechnology file us think that a URL
                     makes
  maps a physical
• This is not how things are intended
  • A URL is a reference to a resource
  • Disconnect the URL from the server’s file system
  • Design URLs!
  • Do URL Mapping!


                                                 3 of 41
Choosing URLs




                4 of 41
Choosing URLs
• Short – easy to share




                          4 of 41
Choosing URLs
• Short – easy to share
• Memorable – easy to remember




                                 4 of 41
Choosing URLs
• Short – easy to share
• Memorable – easy to remember
• Bookmark-able – easy to come back




                                      4 of 41
Choosing URLs
• Short – easy to share
• Memorable – easy to remember
• Bookmark-able – easy to come back
• An aid in site navigation – easy to use



                                            4 of 41
Choosing URLs




                4 of 41
Choosing URLs




                5 of 41
Choosing URLs
• Guess-able – easy to find what you’re looking for




                                                  5 of 41
Choosing URLs
• Guess-able – easy to find what you’re looking for




                                                  5 of 41
Choosing URLs
• Guess-able – easy to find what you’re looking for




                                                  5 of 41
Choosing URLs




                5 of 41
Choosing URLs




                6 of 41
Choosing URLs
• Hackable – easy to navigate




                                6 of 41
Choosing URLs
• Hackable – easy to navigate
• Persistent – easy to come back




                                   6 of 41
Choosing URLs
• Hackable – easy to navigate
• Persistent – easy to come back
• Technology Neutral – easy to grow




                                      6 of 41
Choosing URLs
• Hackable – easy to navigate
• Persistent – easy to come back
• Technology Neutral – easy to grow
• The acid test



                                      6 of 41
Choosing URLs
• Hackable – easy to navigate
• Persistent – easy to come back
• Technology Neutral – easy to grow
• The acid test
     Can you read a URL to
     someone over the phone?



                                      6 of 41
URL Design




             7 of 41
URL Design
• We know how we want the URL to look




                                        7 of 41
URL Design
• We know how we want the URL to look
• But the a physical file requires us to map a
          server technology
  URL to




                                                 7 of 41
URL Design
• We know how we want the URL to look
• But the a physical file requires us to map a
          server technology
  URL to
• How can we implement URL Design?



                                                 7 of 41
URL Design
• We know how we want the URL to look
• But the a physical file requires us to map a
          server technology
  URL to
• How can we implement URL Design?
         URL Mapping
                                                 7 of 41
URL Design
• We know how we want the URL to look
• But the a physical file requires us to map a
          server technology
  URL to
• How can we implement URL Design?
          URL Mapping
Translate the URL to a Lasso file and parameters

                                                   7 of 41
URL Mapping With Lasso




                         8 of 41
URL Mapping With Lasso
• Web Server additions




                         8 of 41
URL Mapping With Lasso
• Web Server additions
 ‣ Apache mod_rewrite




                         8 of 41
URL Mapping With Lasso
• Web Server additions
 ‣ Apache mod_rewrite
 ‣ IISRewrite and ISAPI_Rewrite for IIS




                                          8 of 41
URL Mapping With Lasso
• Web Server additions
 ‣ Apache mod_rewrite
 ‣ IISRewrite and ISAPI_Rewrite for IIS
 ‣ WebSTAR Rewrite




                                          8 of 41
URL Mapping With Lasso
• Web Server additions
 ‣ Apache mod_rewrite
 ‣ IISRewrite and ISAPI_Rewrite for IIS
 ‣ WebSTAR Rewrite
+ Robust and powerful




                                          8 of 41
URL Mapping With Lasso
• Web Server additions
 ‣ Apache mod_rewrite
 ‣ IISRewrite and ISAPI_Rewrite for IIS
 ‣ WebSTAR Rewrite
+ Robust and powerful
– Dependent on web server



                                          8 of 41
URL Mapping With Lasso
• Web Server additions
 ‣ Apache mod_rewrite
 ‣ IISRewrite and ISAPI_Rewrite for IIS
 ‣ WebSTAR Rewrite
+ Robust and powerful
– Dependent on web server
 Completely outside of Lasso – split logic, more to
 learn

                                                      8 of 41
URL Mapping With Lasso




                         8 of 41
URL Mapping With Lasso




                         9 of 41
URL Mapping With Lasso
• mod_rewrite example




                         9 of 41
URL Mapping With Lasso
• mod_rewrite example
 RewriteEngine On
 #RewriteBase /

 # Check to see if the request is a real file or directory
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !.*/Security
 # Everything else gets sent to index.lasso
 RewriteRule ^(.*)$ /index.lasso?response_filepath=/$1 [QSA,L,NS]




                                                                    9 of 41
URL Mapping With Lasso
• mod_rewrite example
 RewriteEngine On
 #RewriteBase /

 # Check to see if the request is a real file or directory
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !.*/Security
 # Everything else gets sent to index.lasso
 RewriteRule ^(.*)$ /index.lasso?response_filepath=/$1 [QSA,L,NS]



          mod_rewrite can take a bit of black
          magic to master
                                                                    9 of 41
URL Mapping With Lasso




                         9 of 41
URL Mapping With Lasso




                         10 of 41
URL Mapping With Lasso
• Lasso Built-In using error.lasso




                                     10 of 41
URL Mapping With Lasso
• Lasso Built-In using error.lasso
 Use a custom error.lasso page to trap requests
 for non-existent files




                                                  10 of 41
URL Mapping With Lasso
• Lasso Built-In using error.lasso
 Use a custom error.lasso page to trap requests
 for non-existent files




                                     error.lasso


                                                   10 of 41
URL Mapping With Lasso




                         10 of 41
URL Mapping With Lasso




                         11 of 41
URL Mapping With Lasso
• Lasso Built-In using [Define_AtBegin]




                                          11 of 41
URL Mapping With Lasso
• Lasso Built-In using [Define_AtBegin]
http://reference.omnipilot.com/LDML8Reference.LassoApp?tag=6564




      prior to processing any code in the current page.




                                                                  11 of 41
Define_Atbegin as URL
      processor




                        12 of 41
Define_Atbegin as URL
       processor
• Defines code that will be executed before each
  page on a site is loaded or executed




                                                   12 of 41
Define_Atbegin as URL
       processor
• Defines code that will be executed before each
  page on a site is loaded or executed
• Look at the requested URL and map it toany
                                           a
  Lasso file and parameters before loading
  page for it




                                                   12 of 41
Advantages with AtBegin




                          13 of 41
Advantages with AtBegin
• Mostly self-contained within Lasso




                                       13 of 41
Advantages with AtBegin
• Mostly self-contained within Lasso
• More portable, less things to setup




                                        13 of 41
Advantages with AtBegin
• Mostly self-contained within Lasso
• More portable, less things to setup
• All logic kept within Lasso




                                        13 of 41
Advantages with AtBegin
• Mostly self-contained within Lasso
• More portable, less things to setup
• All logic kept within Lasso
• Logic can be integrated with rest of site and
  database




                                                  13 of 41
How Does it Work?




                    14 of 41
How Does it Work?
           Visitor

http://www.myweather.com/halmstad/weekend.lasso


         Web Server



                           /halmstad/
           Lasso           weekend.las
                               so




       Normal processing
                                                  14 of 41
How Does it Work?
           Visitor
                                                         Visitor
http://www.myweather.com/halmstad/weekend.lasso



                                             http://www.myweather.com/halmstad/weekend
         Web Server



                           /halmstad/
           Lasso           weekend.las
                               so
                                                     Web Server




                                                       Lasso




                                                    urlhandler_         urlhandler.
                                                                                         index.lasso
                                                   atbegin.lasso            inc




                                                                  AtBegin processing
                                                                                                 14 of 41
Web Server Configuration




                       15 of 41
Web Server Configuration
• Needed to allow URLs without .lasso (optional)




                                                   15 of 41
Web Server Configuration
• Needed to allow URLs without .lasso (optional)
• Apache config
      <LocationMatch quot;^[^.]+$quot;>
      
 # anywhere without file extensions
      
 SetHandler lasso8-handler
      </LocationMatch>




                                                   15 of 41
Web Server Configuration
• Needed to allow URLs without .lasso (optional)
• Apache config
      <LocationMatch quot;^[^.]+$quot;>
      
 # anywhere without file extensions
      
 SetHandler lasso8-handler
      </LocationMatch>




• IIS 6.0 on Windows 2003 Server



                                                   15 of 41
Web Server Configuration
• Needed to allow URLs without .lasso (optional)
• Apache config
      <LocationMatch quot;^[^.]+$quot;>
      
 # anywhere without file extensions
      
 SetHandler lasso8-handler
      </LocationMatch>




• IIS 6.0 on Windows 2003 Server
Wildcard Application Mapping to send requests to
Lasso on a folder-by-folder basis
                                                   15 of 41
Lasso Configuration




                      16 of 41
Lasso Configuration
• Define_AtBegin or globally LassoStartup either
                   must be in
  for a Lasso Site




                                                   16 of 41
Lasso Configuration
• Define_AtBegin or globally LassoStartup either
                   must be in
  for a Lasso Site
    urlhandler_atbegin.lasso
     <?LassoScript
     Define_AtBegin: {
     
 if: file_exists: '/urlhandler.inc';
     
 
 include: '/urlhandler.inc';
     
 /if;
     };




                                                   16 of 41
Lasso Configuration
•   Define_AtBegin must bedefinesLassoScript that either
                            { } in LassoStartup
                                       a Compund
                         Expression, a
    for a Lasso Site or globally in a variable and
                        can be stored
     urlhandler_atbegin.lasso      executed later.
      <?LassoScript
      Define_AtBegin: {
      
 if: file_exists: '/urlhandler.inc';
      
 
 include: '/urlhandler.inc';
      
 /if;
      };




                                                           16 of 41
Lasso Configuration
• Define_AtBegin or globally LassoStartup either
                   must be in
  for a Lasso Site
    urlhandler_atbegin.lasso
     <?LassoScript
     Define_AtBegin: {
     
 if: file_exists: '/urlhandler.inc';
     
 
 include: '/urlhandler.inc';
     
 /if;
     };


We want to keep this as generic and transparent as
possible


                                                   16 of 41
Lasso Configuration
• Define_AtBegin or globally LassoStartup either
                   must be in
  for a Lasso Site
    urlhandler_atbegin.lasso
     <?LassoScript
     Define_AtBegin: {
     
 if: file_exists: '/urlhandler.inc';
     
 
 include: '/urlhandler.inc';
     
 /if;
     };


We want to keep this as generic and transparent as
possible
If urlhandler.inc is not present in a virtual host,
everything works normally
                                                      16 of 41
The URL Handler




                  17 of 41
The URL Handler
• All Lasso requests are passing through one single
  spot




                                                  17 of 41
The URL Handler
• All Lasso requests are passing through one single
  spot
• Parse the requested URL by looking at
  [response_filepath]




                                                  17 of 41
The URL Handler
• All Lasso requests are passing through one single
  spot
• Parse the requested URL by looking at
  [response_filepath]
• Send the result of the parsing to the actual Lasso
  file by setting variables




                                                   17 of 41
The URL Handler




                  17 of 41
The URL Handler




                  18 of 41
The URL Handler
• ExampleofURL handler for a News and Products
  section a site




                                                 18 of 41
The URL Handler
• ExampleofURL handler for a News and Products
  section a site
urlhandler.inc
 <?LassoScript
 // this file is called by the atbegin handler, so it is executed
 // before any page is being processed.
 if: response_filepath -> (endswith: '.lasso') || response_filepath ->
 (endswith: '.lassoapp');
 
 // don't do anything for normal .lasso and .lassoapp requests
 else;
 
 if: response_filepath -> (beginswith: '/news/')
 
 
 || response_filepath -> (beginswith: '/products/');
 
 
 var: 'url_path'=response_filepath,
 
 
 
 'section'='';
 
 
 $url_path -> (removeleading: '/');

                                                                    18 of 41
The URL Handler
• ExampleofURL handler for a News and Products
  section a site

   
   if: !($url_path -> endswith: '/');

   
   
 $url_path += '/';

   
   /if;

   

   
   if: $url_path -> (beginswith: 'news/');

   
   
 // check for pattern /news/2004/12/31/keyword/

   
   
 //using regular expression

   
   
 var: 'pathcheck'=(string_findregexp: $url_path,

   
   
 
 -find='^news/(20d{2})/(0[1-9]|1[0-2])/'

   
   
 
 
 + '([^/]+)/([^/]*)');

   
   
 if: $pathcheck -> size >= 5;

   
   
 
 $section = 'news';

   
   
 
 var: 'newsdate'=($pathcheck -> (get: 2))

   
   
 
 
 + '/' + ($pathcheck -> (get: 3))

   
   
 
 
 + '/' + ($pathcheck -> (get: 4));             18 of 41
The URL Handler
• ExampleofURL handler for a News and Products
  section a site

   
   
 
 $newsdate = (date: $newsdate, -format='%Y/%m/%d');

   
   
 
 var: 'newskeyword'=($pathcheck -> (get: 5)),

   
   
 
 var: 'newsextra'='';

   
   
 
 if: $pathcheck -> size >= 6;

   
   
 
 
 $newsextra=($pathcheck -> (get: 6));

   
   
 
 /if;

   
   
 /if;

   
   else: $url_path -> beginswith: 'products/';

   
   
 $section = 'products';

   
   
 // split up the path in components

   
   
 $url_path = $url_path -> (split: '/');

   
   /if;



                                                                 18 of 41
The URL Handler
• ExampleofURL handler for a News and Products
  section a site

 
 // run site

 
 // use absolute path!

 
 $__HTML_REPLY__ = include:   '/index.lasso';

 
 abort;

 /if;
/if;
?>




                                                   18 of 41
The URL Handler




                  18 of 41
The URL Handler




                  19 of 41
The URL Handler
• index.lasso now has these variables:




                                         19 of 41
The URL Handler
• index.lasso now has these variables:
 $url_path




                                         19 of 41
The URL Handler
• index.lasso now has these variables:
 $url_path
 $section tells the site what main section we are in.




                                                        19 of 41
The URL Handler
• index.lasso now has these variables:
 $url_path
 $section tells the site what main section we are in.
• For the news section also these variables



                                                        19 of 41
The URL Handler
• index.lasso now has these variables:
 $url_path
 $section tells the site what main section we are in.
• For the news section also these variables
 $newsdate publication date, used when getting the news article from database




                                                                            19 of 41
The URL Handler
• index.lasso now has these variables:
 $url_path
 $section tells the site what main section we are in.
• For the news section also these variables
 $newsdate publication date, used when getting the news article from database
 $newskeyword an identification string for the news article



                                                                            19 of 41
The URL Handler
• index.lasso now has these variables:
 $url_path
 $section tells the site what main section we are in.
• For the news section also these variables
 $newsdate publication date, used when getting the news article from database
 $newskeyword an identification string for the news article
 $newsextra optional extra item, for example ‘comments’
        Try it
                                                                            19 of 41
Running The Site




                   20 of 41
Running The Site
•   [Define_AtBegin] will never output anything to
    the web page by itself




                                                     20 of 41
Running The Site
•   [Define_AtBegin] will never output anything to
    the web page by itself
•   Explicitly put the output to the page buffer




                                                     20 of 41
Running The Site
•   [Define_AtBegin] will never output anything to
    the web page by itself
•   Explicitly put the output to the page buffer
•   [abort] so Lasso doesn’t try to run the
    requested file again afterwards




                                                     20 of 41
Running The Site
•   [Define_AtBegin] will never output anything to
    the web page by itself
•   Explicitly put the output to the page buffer
•   [abort] so Lasso doesn’t try to run the
    requested file again afterwards
     $__HTML_REPLY__ = include:   '/index.lasso';
     abort;




                                                     20 of 41
Error Handling




                 21 of 41
Error Handling
• The requested URL is not a physical file so a File
  Not Found can technically not happen




                                                   21 of 41
Error Handling
• The requested URL is not a physical file so a File
  Not Found can technically not happen
• For invalid URLs a be provided status code and
                     proper HTTP
  error page should




                                                   21 of 41
Error Handling
• The requested URL is not a physical file so a File
  Not Found can technically not happen
• For invalid URLs a be provided status code and
                     proper HTTP
  error page should
  • Invalid URL: 404 Not Found


                                                   21 of 41
Error Handling
• The requested URL is not a physical file so a File
  Not Found can technically not happen
• For invalid URLs a be provided status code and
                     proper HTTP
  error page should
  • Invalid URL: 404 Not Found
  • URL no longer available: 410 Gone

                                                   21 of 41
Error Handling
• The requested URL is not a physical file so a File
  Not Found can technically not happen
• For invalid URLs a be provided status code and
                     proper HTTP
  error page should
  • Invalid URL: 404 Not Found
  • URL no longer available: 410 Gone
• See http://www.w3.org/Protocols/HTTP/1.1/
  spec.html#Status-Codes

                                                   21 of 41
Error Handling




                 21 of 41
Error Handling




                 22 of 41
Error Handling
• Custom tag to set HTTP status
  http://tagswap.net/setHTTPstatus




                                     22 of 41
Error Handling
• Custom tag to set HTTP status
  http://tagswap.net/setHTTPstatus
 define_tag: 'setHTTPstatus', -required='statuscode';
 
 // replace status code but keep leading HTTP with version
 
 $__http_header__ = (string_replaceregexp: $__http_header__,
 
 
 -find='(^HTTPS+)s+.*?rn',
 
 
 -replace='1 ' + #statuscode + 'rn');
 /define_tag;

 setHTTPstatus: '404 Not Found';




                                                                 22 of 41
Watch Out




            23 of 41
Watch Out
• Important to debugthe site might fail. every
                     carefully. Otherwise
  page requested on




                                                 23 of 41
Watch Out
• Important to debugthe site might fail. every
                     carefully. Otherwise
  page requested on
• Can’t use abort as debug method – nothing at all
  will output




                                                 23 of 41
Other uses for AtBegin




                         24 of 41
Other uses for AtBegin
• Virtual Host handling




                          24 of 41
Other uses for AtBegin
• Virtual Host handling
• Debugging




                          24 of 41
Other uses for AtBegin
• Virtual Host handling
• Debugging
• Timing of pages




                          24 of 41
Other uses for AtBegin
• Virtual Host handling
• Debugging
• Timing of pages
• Page optimization



                          24 of 41
Other uses for AtBegin
• Virtual Host handling
• Debugging
• Timing of pages
• Page optimization
• Protected downloads


                          24 of 41
Other uses for AtBegin
• Virtual Host handling
• Debugging
• Timing of pages
• Page optimization
• Protected downloads
• Protection of .inc files

                             24 of 41
Other uses for AtBegin
• Virtual Host handling
• Debugging
• Timing of pages
• Page optimization
• Protected downloads
• Protection of .inc files
• Locking down SiteAdmin.LassoApp
                                    24 of 41
Virtual Host Handling




                        25 of 41
Virtual Host Handling
• Look at the ‘host’ field in the request header




                                                   25 of 41
Virtual Host Handling
• Look at the ‘host’ field in the request header
• Direct the request to the site’s folder




                                                   25 of 41
Virtual Host Handling
• Look at the ‘host’ field in the request header
• Direct the request to the site’s folder
- Not for images and other external files



                                                   25 of 41
Virtual Host Handling
• Look at the ‘host’ field in the request header
• Direct the request to the site’s folder
- Not for images and other external files
- Must use relative paths for includes


                                                   25 of 41
Virtual Host Handling




                        25 of 41
Virtual Host Handling




                        26 of 41
Virtual Host Handling
<?LassoScript
var: 'url_path'=response_filepath,

 'host'=client_host; // http://tagswap.net/client_host

// massage the hostname
// www.montania.se turns to montania_se
$host -> (removeleading: 'www.');
$host -> (replace: '.', '_');
// direct the request to the virtual host's subfolder
$url_path = '/' + $host + $url_path;

// run site
$__HTML_REPLY__ = include: $url_path;
abort;
?>




                                                          26 of 41
Debugging




            27 of 41
Debugging
• If you suspectitthat a page makes Lasso to crash
  but can’t find




                                                     27 of 41
Debugging
• If you suspectitthat a page makes Lasso to crash
  but can’t find
• Log the page request to a database in AtBegin




                                                     27 of 41
Debugging
• If you suspectitthat a page makes Lasso to crash
  but can’t find
• Log the page request to a database in AtBegin
• Remove the log entry in AtEnd



                                                     27 of 41
Debugging
• If you suspectitthat a page makes Lasso to crash
  but can’t find
• Log the page request to a database in AtBegin
• Remove the log entry in AtEnd
• Leftover entries are pages that have crashed
  Credit goes to Bil Corry for this idea


                                                     27 of 41
Debugging




            27 of 41
Debugging




            28 of 41
Debugging
<?LassoScript
define_atbegin( {


 if: !(global_defined: 'global_pagedebug');

 
 global: 'global_pagedebug' = map;

 /if;

 var: 'pagedebug_key'=lasso_uniqueid;

 $global_pagedebug -> (insert: $pagedebug_key

 
 = (date -> format: '%Q %T') + ': '

 
 
 + server_name + response_filepath);

 define_atend( {

 
 
 $global_pagedebug -> (remove: $pagedebug_key);

 
 }
 );

 });
?>




                                                       28 of 41
Timing of Pages




                  29 of 41
Timing of Pages
• AtEnd handler logs page requests with
  processing times




                                          29 of 41
Timing of Pages
• AtEnd handler logs page requests with
  processing times
 <?LassoScript
 // Script written by Miles
 // http://tagswap.net/PageLogConsole
 define_atbegin({
 
 var('start_time' = _date_msec);
 
 define_atend({
 
 
 log_detail(response_localpath + ': '
 
 
 
 + (_date_msec - $start_time));
 
 } );
 } );
 ?>




                                            29 of 41
Page Optimization




                    30 of 41
Page Optimization
• AtEnd to remove extra whitespace
  http://tagswap.net/lp_page_trim (Bil Corry)




                                                30 of 41
Page Optimization
• AtEnd to remove extra whitespace
  http://tagswap.net/lp_page_trim (Bil Corry)
• Gzip compression of pages
  http://www.omnipilot.com/TotW.1768.8959.lasso
  (Fletcher Sandbeck)




                                                30 of 41
Protected Downloads




                      31 of 41
Protected Downloads
• Set Lasso to process the download file type




                                                31 of 41
Protected Downloads
• Set Lasso to process the download file type
• AtBegin handler authorizes the download
  request




                                                31 of 41
Protected Downloads
• Set Lasso to process the download file type
• AtBegin handler authorizes the download
  request
• If request is ok, use file_stream to serve the
  requested file




                                                   31 of 41
Protection of .inc Files




                           32 of 41
Protection of .inc Files
• Make .inc files processed by Lasso in Web server




                                                 32 of 41
Protection of .inc Files
• Make .inc files processed by Lasso in Web server
  <?LassoScript
  define_atbegin({
  
 if: response_filepath -> (endswith: '.inc');
  
 
 $__HTML_REPLY__ = '<h1>Not authorized</h1>';
  
 
 // set proper result code too
  
 
 abort;
  
 /if;
  } );
  ?>




                                                     32 of 41
Locking down
SiteAdmin.LassoApp




                     33 of 41
Locking down
    SiteAdmin.LassoApp
• To make from SiteAdmin.LassoApp can only be
           sure
  reached       the server machine




                                                33 of 41
Locking down
    SiteAdmin.LassoApp
• To make from SiteAdmin.LassoApp can only be
           sure
  reached       the server machine
 <?LassoScript
 define_atbegin({
 
 if: response_filepath -> split: '/' -> last
 
 
 -> (beginswith: 'siteadmin.')
 
 
 && response_filepath -> (endswith: '.lassoapp')
 
 
 && client_ip != '127.0.0.1';
 
 
 $__HTML_REPLY__ = '<h1>Not authorized</h1>';
 
 
 // set proper result code too
 
 
 abort;
 
 /if;
 } );
 ?>




                                                       33 of 41
URL Design




             34 of 41
URL Design
• Disconnect the URL from the server’s file
  system




                                              34 of 41
URL Design
• Disconnect the URL from the server’s file
  system
• AtBegin lets us do URL mapping all within Lasso




                                                34 of 41
URL Design
• Disconnect the URL from the server’s file
  system
• AtBegin lets us do URL mapping all within Lasso
• AtBegin has many other interesting uses



                                                34 of 41
URL Design with Lasso

Contenu connexe

Tendances

SharePoint On-Premises Nirvana
SharePoint On-Premises NirvanaSharePoint On-Premises Nirvana
SharePoint On-Premises NirvanaJohn Calvert
 
Schema Design for Riak (Take 2)
Schema Design for Riak (Take 2)Schema Design for Riak (Take 2)
Schema Design for Riak (Take 2)Sean Cribbs
 
Phoenix: How (and why) we put the SQL back into the NoSQL
Phoenix: How (and why) we put the SQL back into the NoSQLPhoenix: How (and why) we put the SQL back into the NoSQL
Phoenix: How (and why) we put the SQL back into the NoSQLDataWorks Summit
 
Verndale - Sitecore User Group Los Angeles Presentation
Verndale - Sitecore User Group Los Angeles PresentationVerndale - Sitecore User Group Los Angeles Presentation
Verndale - Sitecore User Group Los Angeles PresentationDavid Brown
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Brian Culver
 
Responsive Web Design ~ Best Practices for Maximizing ROI
Responsive Web Design ~ Best Practices for Maximizing ROIResponsive Web Design ~ Best Practices for Maximizing ROI
Responsive Web Design ~ Best Practices for Maximizing ROIJuan Carlos Duron
 
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSBest Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSguest7c2e070
 
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the CloudJavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the CloudAaron Walker
 

Tendances (9)

SharePoint On-Premises Nirvana
SharePoint On-Premises NirvanaSharePoint On-Premises Nirvana
SharePoint On-Premises Nirvana
 
Schema Design for Riak (Take 2)
Schema Design for Riak (Take 2)Schema Design for Riak (Take 2)
Schema Design for Riak (Take 2)
 
Phoenix: How (and why) we put the SQL back into the NoSQL
Phoenix: How (and why) we put the SQL back into the NoSQLPhoenix: How (and why) we put the SQL back into the NoSQL
Phoenix: How (and why) we put the SQL back into the NoSQL
 
Verndale - Sitecore User Group Los Angeles Presentation
Verndale - Sitecore User Group Los Angeles PresentationVerndale - Sitecore User Group Los Angeles Presentation
Verndale - Sitecore User Group Los Angeles Presentation
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!
 
Responsive Web Design ~ Best Practices for Maximizing ROI
Responsive Web Design ~ Best Practices for Maximizing ROIResponsive Web Design ~ Best Practices for Maximizing ROI
Responsive Web Design ~ Best Practices for Maximizing ROI
 
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSBest Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
 
RestfulDesignRules
RestfulDesignRulesRestfulDesignRules
RestfulDesignRules
 
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the CloudJavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
 

En vedette

IMPORTANCE OF TECHNOLOGY IN EDUCATION
IMPORTANCE OF TECHNOLOGY IN EDUCATIONIMPORTANCE OF TECHNOLOGY IN EDUCATION
IMPORTANCE OF TECHNOLOGY IN EDUCATIONsaymar2015
 
IMPORTANCE OF TECHNOLOGY IN EDUCATION
IMPORTANCE OF TECHNOLOGY IN EDUCATIONIMPORTANCE OF TECHNOLOGY IN EDUCATION
IMPORTANCE OF TECHNOLOGY IN EDUCATIONROMBLONFlorisa20
 
Importance of Technology in Education
Importance of Technology in EducationImportance of Technology in Education
Importance of Technology in EducationLilibeth Ricaborda
 
Цементийн тухай - Цементийн үйлдвэр
Цементийн тухай - Цементийн үйлдвэрЦементийн тухай - Цементийн үйлдвэр
Цементийн тухай - Цементийн үйлдвэрErdembileg L. Ganbaatar
 
цементийн тухай анхан шатны ойлголт
цементийн тухай анхан шатны ойлголтцементийн тухай анхан шатны ойлголт
цементийн тухай анхан шатны ойлголтBaigalia Baigalaa
 
ХҮЙТЭН ЦАГ АГААРЫН НӨХЦӨЛД ЦЕМЕНТ БЕТОН АВТО ЗАМ БАРИХ Орчуулсан Ц.Баярсайхан...
ХҮЙТЭН ЦАГ АГААРЫН НӨХЦӨЛД ЦЕМЕНТ БЕТОН АВТО ЗАМ БАРИХ Орчуулсан Ц.Баярсайхан...ХҮЙТЭН ЦАГ АГААРЫН НӨХЦӨЛД ЦЕМЕНТ БЕТОН АВТО ЗАМ БАРИХ Орчуулсан Ц.Баярсайхан...
ХҮЙТЭН ЦАГ АГААРЫН НӨХЦӨЛД ЦЕМЕНТ БЕТОН АВТО ЗАМ БАРИХ Орчуулсан Ц.Баярсайхан...Bayar Tsend
 
Technical SEO Myths Facts And Theories On Crawl Budget And The Importance Of ...
Technical SEO Myths Facts And Theories On Crawl Budget And The Importance Of ...Technical SEO Myths Facts And Theories On Crawl Budget And The Importance Of ...
Technical SEO Myths Facts And Theories On Crawl Budget And The Importance Of ...Dawn Anderson MSc DigM
 
Webpage Classification
Webpage ClassificationWebpage Classification
Webpage ClassificationPacharaStudio
 
Guest Lecture 30th May 2012 University of Technology, Sydney (UTS) Master of...
Guest Lecture 30th May 2012 University of Technology, Sydney (UTS)  Master of...Guest Lecture 30th May 2012 University of Technology, Sydney (UTS)  Master of...
Guest Lecture 30th May 2012 University of Technology, Sydney (UTS) Master of...Neerav Bhatt
 
Information Technology
Information TechnologyInformation Technology
Information TechnologyViraj Kansara
 
The importance of technology in education
The importance of technology in educationThe importance of technology in education
The importance of technology in educationCatherine Casper
 
35 Inspiring Small Business Ideas to Start on a Small Budget
35 Inspiring Small Business Ideas to Start on a Small Budget35 Inspiring Small Business Ideas to Start on a Small Budget
35 Inspiring Small Business Ideas to Start on a Small BudgetOxbridge Academy
 

En vedette (20)

Education: Master IT (health)
Education: Master IT (health)Education: Master IT (health)
Education: Master IT (health)
 
IIT
IITIIT
IIT
 
IMPORTANCE OF TECHNOLOGY IN EDUCATION
IMPORTANCE OF TECHNOLOGY IN EDUCATIONIMPORTANCE OF TECHNOLOGY IN EDUCATION
IMPORTANCE OF TECHNOLOGY IN EDUCATION
 
IMPORTANCE OF TECHNOLOGY IN EDUCATION
IMPORTANCE OF TECHNOLOGY IN EDUCATIONIMPORTANCE OF TECHNOLOGY IN EDUCATION
IMPORTANCE OF TECHNOLOGY IN EDUCATION
 
Importance of Technology in Education
Importance of Technology in EducationImportance of Technology in Education
Importance of Technology in Education
 
Гөлтгөнө, Gypsum
Гөлтгөнө, GypsumГөлтгөнө, Gypsum
Гөлтгөнө, Gypsum
 
Цементийн тухай - Цементийн үйлдвэр
Цементийн тухай - Цементийн үйлдвэрЦементийн тухай - Цементийн үйлдвэр
Цементийн тухай - Цементийн үйлдвэр
 
цементийн тухай анхан шатны ойлголт
цементийн тухай анхан шатны ойлголтцементийн тухай анхан шатны ойлголт
цементийн тухай анхан шатны ойлголт
 
ХҮЙТЭН ЦАГ АГААРЫН НӨХЦӨЛД ЦЕМЕНТ БЕТОН АВТО ЗАМ БАРИХ Орчуулсан Ц.Баярсайхан...
ХҮЙТЭН ЦАГ АГААРЫН НӨХЦӨЛД ЦЕМЕНТ БЕТОН АВТО ЗАМ БАРИХ Орчуулсан Ц.Баярсайхан...ХҮЙТЭН ЦАГ АГААРЫН НӨХЦӨЛД ЦЕМЕНТ БЕТОН АВТО ЗАМ БАРИХ Орчуулсан Ц.Баярсайхан...
ХҮЙТЭН ЦАГ АГААРЫН НӨХЦӨЛД ЦЕМЕНТ БЕТОН АВТО ЗАМ БАРИХ Орчуулсан Ц.Баярсайхан...
 
Technical SEO Myths Facts And Theories On Crawl Budget And The Importance Of ...
Technical SEO Myths Facts And Theories On Crawl Budget And The Importance Of ...Technical SEO Myths Facts And Theories On Crawl Budget And The Importance Of ...
Technical SEO Myths Facts And Theories On Crawl Budget And The Importance Of ...
 
Web page concept final ppt
Web page concept  final pptWeb page concept  final ppt
Web page concept final ppt
 
Http Vs Https .
Http Vs Https . Http Vs Https .
Http Vs Https .
 
3.2.1 The Internet
3.2.1 The Internet3.2.1 The Internet
3.2.1 The Internet
 
3.3 Internet Services
3.3 Internet Services3.3 Internet Services
3.3 Internet Services
 
Web browser
Web browserWeb browser
Web browser
 
Webpage Classification
Webpage ClassificationWebpage Classification
Webpage Classification
 
Guest Lecture 30th May 2012 University of Technology, Sydney (UTS) Master of...
Guest Lecture 30th May 2012 University of Technology, Sydney (UTS)  Master of...Guest Lecture 30th May 2012 University of Technology, Sydney (UTS)  Master of...
Guest Lecture 30th May 2012 University of Technology, Sydney (UTS) Master of...
 
Information Technology
Information TechnologyInformation Technology
Information Technology
 
The importance of technology in education
The importance of technology in educationThe importance of technology in education
The importance of technology in education
 
35 Inspiring Small Business Ideas to Start on a Small Budget
35 Inspiring Small Business Ideas to Start on a Small Budget35 Inspiring Small Business Ideas to Start on a Small Budget
35 Inspiring Small Business Ideas to Start on a Small Budget
 

Similaire à URL Design with Lasso

Apache Solr Changes the Way You Build Sites
Apache Solr Changes the Way You Build SitesApache Solr Changes the Way You Build Sites
Apache Solr Changes the Way You Build SitesPeter
 
Research on Key Technology of Web Reptile
Research on Key Technology of Web ReptileResearch on Key Technology of Web Reptile
Research on Key Technology of Web ReptileIRJESJOURNAL
 
VTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData projectVTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData projectTom Klaasen
 
NewBCamp08: Intro to Web Standards
NewBCamp08: Intro to Web StandardsNewBCamp08: Intro to Web Standards
NewBCamp08: Intro to Web StandardsAdam Darowski
 
Contributing To Rails By Plugin Gem
Contributing To Rails By Plugin GemContributing To Rails By Plugin Gem
Contributing To Rails By Plugin GemDaniel Lv
 
How to SEO (intro)
How to SEO (intro)How to SEO (intro)
How to SEO (intro)SEO Officers
 
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQLNoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQLAndrew Morgan
 
DNS: from manual records to a modern & dynamic approach
DNS: from manual records to a modern & dynamic approachDNS: from manual records to a modern & dynamic approach
DNS: from manual records to a modern & dynamic approachScaleway
 
Microsoft SharePoint Server 2007
Microsoft SharePoint Server 2007Microsoft SharePoint Server 2007
Microsoft SharePoint Server 2007ITDogadjaji.com
 
Seomoz - SEO Training
Seomoz - SEO TrainingSeomoz - SEO Training
Seomoz - SEO TrainingJerome Ruben
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefNathen Harvey
 
UKOUG2018 - I Know what you did Last Summer [in my Database].pptx
UKOUG2018 - I Know what you did Last Summer [in my Database].pptxUKOUG2018 - I Know what you did Last Summer [in my Database].pptx
UKOUG2018 - I Know what you did Last Summer [in my Database].pptxMarco Gralike
 
21 Ways to Make WordPress Fast
21 Ways to Make WordPress Fast21 Ways to Make WordPress Fast
21 Ways to Make WordPress FastJason McCreary
 
Wes Leonardo - Putting AIR into your Application
Wes Leonardo - Putting AIR into your ApplicationWes Leonardo - Putting AIR into your Application
Wes Leonardo - Putting AIR into your Application360|Conferences
 
Y Pipes Mashup Camp
Y Pipes Mashup CampY Pipes Mashup Camp
Y Pipes Mashup CampJinho Jung
 
EContent_11_2022_12_09_22_13_58_UnitISRPpdf__2022_10_11_14_14_42.pdf
EContent_11_2022_12_09_22_13_58_UnitISRPpdf__2022_10_11_14_14_42.pdfEContent_11_2022_12_09_22_13_58_UnitISRPpdf__2022_10_11_14_14_42.pdf
EContent_11_2022_12_09_22_13_58_UnitISRPpdf__2022_10_11_14_14_42.pdfSANKETKOTAK5
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBMongoDB
 

Similaire à URL Design with Lasso (20)

Apache Solr Changes the Way You Build Sites
Apache Solr Changes the Way You Build SitesApache Solr Changes the Way You Build Sites
Apache Solr Changes the Way You Build Sites
 
Web Design
Web DesignWeb Design
Web Design
 
Research on Key Technology of Web Reptile
Research on Key Technology of Web ReptileResearch on Key Technology of Web Reptile
Research on Key Technology of Web Reptile
 
VTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData projectVTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData project
 
Sinatra
SinatraSinatra
Sinatra
 
NewBCamp08: Intro to Web Standards
NewBCamp08: Intro to Web StandardsNewBCamp08: Intro to Web Standards
NewBCamp08: Intro to Web Standards
 
Contributing To Rails By Plugin Gem
Contributing To Rails By Plugin GemContributing To Rails By Plugin Gem
Contributing To Rails By Plugin Gem
 
How to SEO (intro)
How to SEO (intro)How to SEO (intro)
How to SEO (intro)
 
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQLNoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
 
DNS: from manual records to a modern & dynamic approach
DNS: from manual records to a modern & dynamic approachDNS: from manual records to a modern & dynamic approach
DNS: from manual records to a modern & dynamic approach
 
Microsoft SharePoint Server 2007
Microsoft SharePoint Server 2007Microsoft SharePoint Server 2007
Microsoft SharePoint Server 2007
 
Seo training-seo2 india-devang barot
Seo training-seo2 india-devang barotSeo training-seo2 india-devang barot
Seo training-seo2 india-devang barot
 
Seomoz - SEO Training
Seomoz - SEO TrainingSeomoz - SEO Training
Seomoz - SEO Training
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
UKOUG2018 - I Know what you did Last Summer [in my Database].pptx
UKOUG2018 - I Know what you did Last Summer [in my Database].pptxUKOUG2018 - I Know what you did Last Summer [in my Database].pptx
UKOUG2018 - I Know what you did Last Summer [in my Database].pptx
 
21 Ways to Make WordPress Fast
21 Ways to Make WordPress Fast21 Ways to Make WordPress Fast
21 Ways to Make WordPress Fast
 
Wes Leonardo - Putting AIR into your Application
Wes Leonardo - Putting AIR into your ApplicationWes Leonardo - Putting AIR into your Application
Wes Leonardo - Putting AIR into your Application
 
Y Pipes Mashup Camp
Y Pipes Mashup CampY Pipes Mashup Camp
Y Pipes Mashup Camp
 
EContent_11_2022_12_09_22_13_58_UnitISRPpdf__2022_10_11_14_14_42.pdf
EContent_11_2022_12_09_22_13_58_UnitISRPpdf__2022_10_11_14_14_42.pdfEContent_11_2022_12_09_22_13_58_UnitISRPpdf__2022_10_11_14_14_42.pdf
EContent_11_2022_12_09_22_13_58_UnitISRPpdf__2022_10_11_14_14_42.pdf
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
 

Dernier

Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMVoces Mineras
 
Chapter 9 PPT 4th edition.pdf internal audit
Chapter 9 PPT 4th edition.pdf internal auditChapter 9 PPT 4th edition.pdf internal audit
Chapter 9 PPT 4th edition.pdf internal auditNhtLNguyn9
 
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCRashishs7044
 
Cyber Security Training in Office Environment
Cyber Security Training in Office EnvironmentCyber Security Training in Office Environment
Cyber Security Training in Office Environmentelijahj01012
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Riya Pathan
 
Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfInnovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfrichard876048
 
8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCR8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCRashishs7044
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607dollysharma2066
 
APRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfAPRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfRbc Rbcua
 
Entrepreneurship lessons in Philippines
Entrepreneurship lessons in  PhilippinesEntrepreneurship lessons in  Philippines
Entrepreneurship lessons in PhilippinesDavidSamuel525586
 
Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessSeta Wicaksana
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Kirill Klimov
 
PB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal BrandPB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal BrandSharisaBethune
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?Olivia Kresic
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckHajeJanKamps
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607dollysharma2066
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCRashishs7044
 

Dernier (20)

Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQM
 
Chapter 9 PPT 4th edition.pdf internal audit
Chapter 9 PPT 4th edition.pdf internal auditChapter 9 PPT 4th edition.pdf internal audit
Chapter 9 PPT 4th edition.pdf internal audit
 
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
 
Cyber Security Training in Office Environment
Cyber Security Training in Office EnvironmentCyber Security Training in Office Environment
Cyber Security Training in Office Environment
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737
 
Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfInnovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdf
 
8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCR8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCR
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
 
APRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfAPRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdf
 
Entrepreneurship lessons in Philippines
Entrepreneurship lessons in  PhilippinesEntrepreneurship lessons in  Philippines
Entrepreneurship lessons in Philippines
 
Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful Business
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024
 
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
 
PB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal BrandPB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal Brand
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
 
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
 
Call Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North GoaCall Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North Goa
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
 

URL Design with Lasso

  • 1. URL Design – Methods to Use Friendly URLs
  • 2. URL Design – Methods to Use Friendly URLs   by Johan Sölve Montania System AB, Sweden www.montania.se
  • 3. URL Design – Methods to Use Friendly URLs   by Johan Sölve Montania System AB, Sweden www.montania.se • Software and consulting company • Business administration solutions for small- and medium-sized business
  • 4. URL Design 2 of 41
  • 5. URL Design 2 of 41
  • 6. URL Design 2 of 41
  • 7. URL Design 2 of 41
  • 8. URL Design 2 of 41
  • 9. A URL is not a Filename 3 of 41
  • 10. A URL is not a Filename • Servertotechnology file us think that a URL makes maps a physical 3 of 41
  • 11. A URL is not a Filename • Servertotechnology file us think that a URL makes maps a physical • This is not how things are intended 3 of 41
  • 12. A URL is not a Filename • Servertotechnology file us think that a URL makes maps a physical • This is not how things are intended • A URL is a reference to a resource 3 of 41
  • 13. A URL is not a Filename • Servertotechnology file us think that a URL makes maps a physical • This is not how things are intended • A URL is a reference to a resource • Disconnect the URL from the server’s file system 3 of 41
  • 14. A URL is not a Filename • Servertotechnology file us think that a URL makes maps a physical • This is not how things are intended • A URL is a reference to a resource • Disconnect the URL from the server’s file system • Design URLs! 3 of 41
  • 15. A URL is not a Filename • Servertotechnology file us think that a URL makes maps a physical • This is not how things are intended • A URL is a reference to a resource • Disconnect the URL from the server’s file system • Design URLs! • Do URL Mapping! 3 of 41
  • 16. Choosing URLs 4 of 41
  • 17. Choosing URLs • Short – easy to share 4 of 41
  • 18. Choosing URLs • Short – easy to share • Memorable – easy to remember 4 of 41
  • 19. Choosing URLs • Short – easy to share • Memorable – easy to remember • Bookmark-able – easy to come back 4 of 41
  • 20. Choosing URLs • Short – easy to share • Memorable – easy to remember • Bookmark-able – easy to come back • An aid in site navigation – easy to use 4 of 41
  • 21. Choosing URLs 4 of 41
  • 22. Choosing URLs 5 of 41
  • 23. Choosing URLs • Guess-able – easy to find what you’re looking for 5 of 41
  • 24. Choosing URLs • Guess-able – easy to find what you’re looking for 5 of 41
  • 25. Choosing URLs • Guess-able – easy to find what you’re looking for 5 of 41
  • 26. Choosing URLs 5 of 41
  • 27. Choosing URLs 6 of 41
  • 28. Choosing URLs • Hackable – easy to navigate 6 of 41
  • 29. Choosing URLs • Hackable – easy to navigate • Persistent – easy to come back 6 of 41
  • 30. Choosing URLs • Hackable – easy to navigate • Persistent – easy to come back • Technology Neutral – easy to grow 6 of 41
  • 31. Choosing URLs • Hackable – easy to navigate • Persistent – easy to come back • Technology Neutral – easy to grow • The acid test 6 of 41
  • 32. Choosing URLs • Hackable – easy to navigate • Persistent – easy to come back • Technology Neutral – easy to grow • The acid test Can you read a URL to someone over the phone? 6 of 41
  • 33. URL Design 7 of 41
  • 34. URL Design • We know how we want the URL to look 7 of 41
  • 35. URL Design • We know how we want the URL to look • But the a physical file requires us to map a server technology URL to 7 of 41
  • 36. URL Design • We know how we want the URL to look • But the a physical file requires us to map a server technology URL to • How can we implement URL Design? 7 of 41
  • 37. URL Design • We know how we want the URL to look • But the a physical file requires us to map a server technology URL to • How can we implement URL Design? URL Mapping 7 of 41
  • 38. URL Design • We know how we want the URL to look • But the a physical file requires us to map a server technology URL to • How can we implement URL Design? URL Mapping Translate the URL to a Lasso file and parameters 7 of 41
  • 39. URL Mapping With Lasso 8 of 41
  • 40. URL Mapping With Lasso • Web Server additions 8 of 41
  • 41. URL Mapping With Lasso • Web Server additions ‣ Apache mod_rewrite 8 of 41
  • 42. URL Mapping With Lasso • Web Server additions ‣ Apache mod_rewrite ‣ IISRewrite and ISAPI_Rewrite for IIS 8 of 41
  • 43. URL Mapping With Lasso • Web Server additions ‣ Apache mod_rewrite ‣ IISRewrite and ISAPI_Rewrite for IIS ‣ WebSTAR Rewrite 8 of 41
  • 44. URL Mapping With Lasso • Web Server additions ‣ Apache mod_rewrite ‣ IISRewrite and ISAPI_Rewrite for IIS ‣ WebSTAR Rewrite + Robust and powerful 8 of 41
  • 45. URL Mapping With Lasso • Web Server additions ‣ Apache mod_rewrite ‣ IISRewrite and ISAPI_Rewrite for IIS ‣ WebSTAR Rewrite + Robust and powerful – Dependent on web server 8 of 41
  • 46. URL Mapping With Lasso • Web Server additions ‣ Apache mod_rewrite ‣ IISRewrite and ISAPI_Rewrite for IIS ‣ WebSTAR Rewrite + Robust and powerful – Dependent on web server Completely outside of Lasso – split logic, more to learn 8 of 41
  • 47. URL Mapping With Lasso 8 of 41
  • 48. URL Mapping With Lasso 9 of 41
  • 49. URL Mapping With Lasso • mod_rewrite example 9 of 41
  • 50. URL Mapping With Lasso • mod_rewrite example RewriteEngine On #RewriteBase / # Check to see if the request is a real file or directory RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !.*/Security # Everything else gets sent to index.lasso RewriteRule ^(.*)$ /index.lasso?response_filepath=/$1 [QSA,L,NS] 9 of 41
  • 51. URL Mapping With Lasso • mod_rewrite example RewriteEngine On #RewriteBase / # Check to see if the request is a real file or directory RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !.*/Security # Everything else gets sent to index.lasso RewriteRule ^(.*)$ /index.lasso?response_filepath=/$1 [QSA,L,NS] mod_rewrite can take a bit of black magic to master 9 of 41
  • 52. URL Mapping With Lasso 9 of 41
  • 53. URL Mapping With Lasso 10 of 41
  • 54. URL Mapping With Lasso • Lasso Built-In using error.lasso 10 of 41
  • 55. URL Mapping With Lasso • Lasso Built-In using error.lasso Use a custom error.lasso page to trap requests for non-existent files 10 of 41
  • 56. URL Mapping With Lasso • Lasso Built-In using error.lasso Use a custom error.lasso page to trap requests for non-existent files error.lasso 10 of 41
  • 57. URL Mapping With Lasso 10 of 41
  • 58. URL Mapping With Lasso 11 of 41
  • 59. URL Mapping With Lasso • Lasso Built-In using [Define_AtBegin] 11 of 41
  • 60. URL Mapping With Lasso • Lasso Built-In using [Define_AtBegin] http://reference.omnipilot.com/LDML8Reference.LassoApp?tag=6564 prior to processing any code in the current page. 11 of 41
  • 61. Define_Atbegin as URL processor 12 of 41
  • 62. Define_Atbegin as URL processor • Defines code that will be executed before each page on a site is loaded or executed 12 of 41
  • 63. Define_Atbegin as URL processor • Defines code that will be executed before each page on a site is loaded or executed • Look at the requested URL and map it toany a Lasso file and parameters before loading page for it 12 of 41
  • 65. Advantages with AtBegin • Mostly self-contained within Lasso 13 of 41
  • 66. Advantages with AtBegin • Mostly self-contained within Lasso • More portable, less things to setup 13 of 41
  • 67. Advantages with AtBegin • Mostly self-contained within Lasso • More portable, less things to setup • All logic kept within Lasso 13 of 41
  • 68. Advantages with AtBegin • Mostly self-contained within Lasso • More portable, less things to setup • All logic kept within Lasso • Logic can be integrated with rest of site and database 13 of 41
  • 69. How Does it Work? 14 of 41
  • 70. How Does it Work? Visitor http://www.myweather.com/halmstad/weekend.lasso Web Server /halmstad/ Lasso weekend.las so Normal processing 14 of 41
  • 71. How Does it Work? Visitor Visitor http://www.myweather.com/halmstad/weekend.lasso http://www.myweather.com/halmstad/weekend Web Server /halmstad/ Lasso weekend.las so Web Server Lasso urlhandler_ urlhandler. index.lasso atbegin.lasso inc AtBegin processing 14 of 41
  • 73. Web Server Configuration • Needed to allow URLs without .lasso (optional) 15 of 41
  • 74. Web Server Configuration • Needed to allow URLs without .lasso (optional) • Apache config <LocationMatch quot;^[^.]+$quot;> # anywhere without file extensions SetHandler lasso8-handler </LocationMatch> 15 of 41
  • 75. Web Server Configuration • Needed to allow URLs without .lasso (optional) • Apache config <LocationMatch quot;^[^.]+$quot;> # anywhere without file extensions SetHandler lasso8-handler </LocationMatch> • IIS 6.0 on Windows 2003 Server 15 of 41
  • 76. Web Server Configuration • Needed to allow URLs without .lasso (optional) • Apache config <LocationMatch quot;^[^.]+$quot;> # anywhere without file extensions SetHandler lasso8-handler </LocationMatch> • IIS 6.0 on Windows 2003 Server Wildcard Application Mapping to send requests to Lasso on a folder-by-folder basis 15 of 41
  • 78. Lasso Configuration • Define_AtBegin or globally LassoStartup either must be in for a Lasso Site 16 of 41
  • 79. Lasso Configuration • Define_AtBegin or globally LassoStartup either must be in for a Lasso Site urlhandler_atbegin.lasso <?LassoScript Define_AtBegin: { if: file_exists: '/urlhandler.inc'; include: '/urlhandler.inc'; /if; }; 16 of 41
  • 80. Lasso Configuration • Define_AtBegin must bedefinesLassoScript that either { } in LassoStartup a Compund Expression, a for a Lasso Site or globally in a variable and can be stored urlhandler_atbegin.lasso executed later. <?LassoScript Define_AtBegin: { if: file_exists: '/urlhandler.inc'; include: '/urlhandler.inc'; /if; }; 16 of 41
  • 81. Lasso Configuration • Define_AtBegin or globally LassoStartup either must be in for a Lasso Site urlhandler_atbegin.lasso <?LassoScript Define_AtBegin: { if: file_exists: '/urlhandler.inc'; include: '/urlhandler.inc'; /if; }; We want to keep this as generic and transparent as possible 16 of 41
  • 82. Lasso Configuration • Define_AtBegin or globally LassoStartup either must be in for a Lasso Site urlhandler_atbegin.lasso <?LassoScript Define_AtBegin: { if: file_exists: '/urlhandler.inc'; include: '/urlhandler.inc'; /if; }; We want to keep this as generic and transparent as possible If urlhandler.inc is not present in a virtual host, everything works normally 16 of 41
  • 83. The URL Handler 17 of 41
  • 84. The URL Handler • All Lasso requests are passing through one single spot 17 of 41
  • 85. The URL Handler • All Lasso requests are passing through one single spot • Parse the requested URL by looking at [response_filepath] 17 of 41
  • 86. The URL Handler • All Lasso requests are passing through one single spot • Parse the requested URL by looking at [response_filepath] • Send the result of the parsing to the actual Lasso file by setting variables 17 of 41
  • 87. The URL Handler 17 of 41
  • 88. The URL Handler 18 of 41
  • 89. The URL Handler • ExampleofURL handler for a News and Products section a site 18 of 41
  • 90. The URL Handler • ExampleofURL handler for a News and Products section a site urlhandler.inc <?LassoScript // this file is called by the atbegin handler, so it is executed // before any page is being processed. if: response_filepath -> (endswith: '.lasso') || response_filepath -> (endswith: '.lassoapp'); // don't do anything for normal .lasso and .lassoapp requests else; if: response_filepath -> (beginswith: '/news/') || response_filepath -> (beginswith: '/products/'); var: 'url_path'=response_filepath, 'section'=''; $url_path -> (removeleading: '/'); 18 of 41
  • 91. The URL Handler • ExampleofURL handler for a News and Products section a site if: !($url_path -> endswith: '/'); $url_path += '/'; /if; if: $url_path -> (beginswith: 'news/'); // check for pattern /news/2004/12/31/keyword/ //using regular expression var: 'pathcheck'=(string_findregexp: $url_path, -find='^news/(20d{2})/(0[1-9]|1[0-2])/' + '([^/]+)/([^/]*)'); if: $pathcheck -> size >= 5; $section = 'news'; var: 'newsdate'=($pathcheck -> (get: 2)) + '/' + ($pathcheck -> (get: 3)) + '/' + ($pathcheck -> (get: 4)); 18 of 41
  • 92. The URL Handler • ExampleofURL handler for a News and Products section a site $newsdate = (date: $newsdate, -format='%Y/%m/%d'); var: 'newskeyword'=($pathcheck -> (get: 5)), var: 'newsextra'=''; if: $pathcheck -> size >= 6; $newsextra=($pathcheck -> (get: 6)); /if; /if; else: $url_path -> beginswith: 'products/'; $section = 'products'; // split up the path in components $url_path = $url_path -> (split: '/'); /if; 18 of 41
  • 93. The URL Handler • ExampleofURL handler for a News and Products section a site // run site // use absolute path! $__HTML_REPLY__ = include: '/index.lasso'; abort; /if; /if; ?> 18 of 41
  • 94. The URL Handler 18 of 41
  • 95. The URL Handler 19 of 41
  • 96. The URL Handler • index.lasso now has these variables: 19 of 41
  • 97. The URL Handler • index.lasso now has these variables: $url_path 19 of 41
  • 98. The URL Handler • index.lasso now has these variables: $url_path $section tells the site what main section we are in. 19 of 41
  • 99. The URL Handler • index.lasso now has these variables: $url_path $section tells the site what main section we are in. • For the news section also these variables 19 of 41
  • 100. The URL Handler • index.lasso now has these variables: $url_path $section tells the site what main section we are in. • For the news section also these variables $newsdate publication date, used when getting the news article from database 19 of 41
  • 101. The URL Handler • index.lasso now has these variables: $url_path $section tells the site what main section we are in. • For the news section also these variables $newsdate publication date, used when getting the news article from database $newskeyword an identification string for the news article 19 of 41
  • 102. The URL Handler • index.lasso now has these variables: $url_path $section tells the site what main section we are in. • For the news section also these variables $newsdate publication date, used when getting the news article from database $newskeyword an identification string for the news article $newsextra optional extra item, for example ‘comments’ Try it 19 of 41
  • 103. Running The Site 20 of 41
  • 104. Running The Site • [Define_AtBegin] will never output anything to the web page by itself 20 of 41
  • 105. Running The Site • [Define_AtBegin] will never output anything to the web page by itself • Explicitly put the output to the page buffer 20 of 41
  • 106. Running The Site • [Define_AtBegin] will never output anything to the web page by itself • Explicitly put the output to the page buffer • [abort] so Lasso doesn’t try to run the requested file again afterwards 20 of 41
  • 107. Running The Site • [Define_AtBegin] will never output anything to the web page by itself • Explicitly put the output to the page buffer • [abort] so Lasso doesn’t try to run the requested file again afterwards $__HTML_REPLY__ = include: '/index.lasso'; abort; 20 of 41
  • 108. Error Handling 21 of 41
  • 109. Error Handling • The requested URL is not a physical file so a File Not Found can technically not happen 21 of 41
  • 110. Error Handling • The requested URL is not a physical file so a File Not Found can technically not happen • For invalid URLs a be provided status code and proper HTTP error page should 21 of 41
  • 111. Error Handling • The requested URL is not a physical file so a File Not Found can technically not happen • For invalid URLs a be provided status code and proper HTTP error page should • Invalid URL: 404 Not Found 21 of 41
  • 112. Error Handling • The requested URL is not a physical file so a File Not Found can technically not happen • For invalid URLs a be provided status code and proper HTTP error page should • Invalid URL: 404 Not Found • URL no longer available: 410 Gone 21 of 41
  • 113. Error Handling • The requested URL is not a physical file so a File Not Found can technically not happen • For invalid URLs a be provided status code and proper HTTP error page should • Invalid URL: 404 Not Found • URL no longer available: 410 Gone • See http://www.w3.org/Protocols/HTTP/1.1/ spec.html#Status-Codes 21 of 41
  • 114. Error Handling 21 of 41
  • 115. Error Handling 22 of 41
  • 116. Error Handling • Custom tag to set HTTP status http://tagswap.net/setHTTPstatus 22 of 41
  • 117. Error Handling • Custom tag to set HTTP status http://tagswap.net/setHTTPstatus define_tag: 'setHTTPstatus', -required='statuscode'; // replace status code but keep leading HTTP with version $__http_header__ = (string_replaceregexp: $__http_header__, -find='(^HTTPS+)s+.*?rn', -replace='1 ' + #statuscode + 'rn'); /define_tag; setHTTPstatus: '404 Not Found'; 22 of 41
  • 118. Watch Out 23 of 41
  • 119. Watch Out • Important to debugthe site might fail. every carefully. Otherwise page requested on 23 of 41
  • 120. Watch Out • Important to debugthe site might fail. every carefully. Otherwise page requested on • Can’t use abort as debug method – nothing at all will output 23 of 41
  • 121. Other uses for AtBegin 24 of 41
  • 122. Other uses for AtBegin • Virtual Host handling 24 of 41
  • 123. Other uses for AtBegin • Virtual Host handling • Debugging 24 of 41
  • 124. Other uses for AtBegin • Virtual Host handling • Debugging • Timing of pages 24 of 41
  • 125. Other uses for AtBegin • Virtual Host handling • Debugging • Timing of pages • Page optimization 24 of 41
  • 126. Other uses for AtBegin • Virtual Host handling • Debugging • Timing of pages • Page optimization • Protected downloads 24 of 41
  • 127. Other uses for AtBegin • Virtual Host handling • Debugging • Timing of pages • Page optimization • Protected downloads • Protection of .inc files 24 of 41
  • 128. Other uses for AtBegin • Virtual Host handling • Debugging • Timing of pages • Page optimization • Protected downloads • Protection of .inc files • Locking down SiteAdmin.LassoApp 24 of 41
  • 130. Virtual Host Handling • Look at the ‘host’ field in the request header 25 of 41
  • 131. Virtual Host Handling • Look at the ‘host’ field in the request header • Direct the request to the site’s folder 25 of 41
  • 132. Virtual Host Handling • Look at the ‘host’ field in the request header • Direct the request to the site’s folder - Not for images and other external files 25 of 41
  • 133. Virtual Host Handling • Look at the ‘host’ field in the request header • Direct the request to the site’s folder - Not for images and other external files - Must use relative paths for includes 25 of 41
  • 136. Virtual Host Handling <?LassoScript var: 'url_path'=response_filepath, 'host'=client_host; // http://tagswap.net/client_host // massage the hostname // www.montania.se turns to montania_se $host -> (removeleading: 'www.'); $host -> (replace: '.', '_'); // direct the request to the virtual host's subfolder $url_path = '/' + $host + $url_path; // run site $__HTML_REPLY__ = include: $url_path; abort; ?> 26 of 41
  • 137. Debugging 27 of 41
  • 138. Debugging • If you suspectitthat a page makes Lasso to crash but can’t find 27 of 41
  • 139. Debugging • If you suspectitthat a page makes Lasso to crash but can’t find • Log the page request to a database in AtBegin 27 of 41
  • 140. Debugging • If you suspectitthat a page makes Lasso to crash but can’t find • Log the page request to a database in AtBegin • Remove the log entry in AtEnd 27 of 41
  • 141. Debugging • If you suspectitthat a page makes Lasso to crash but can’t find • Log the page request to a database in AtBegin • Remove the log entry in AtEnd • Leftover entries are pages that have crashed Credit goes to Bil Corry for this idea 27 of 41
  • 142. Debugging 27 of 41
  • 143. Debugging 28 of 41
  • 144. Debugging <?LassoScript define_atbegin( { if: !(global_defined: 'global_pagedebug'); global: 'global_pagedebug' = map; /if; var: 'pagedebug_key'=lasso_uniqueid; $global_pagedebug -> (insert: $pagedebug_key = (date -> format: '%Q %T') + ': ' + server_name + response_filepath); define_atend( { $global_pagedebug -> (remove: $pagedebug_key); } ); }); ?> 28 of 41
  • 145. Timing of Pages 29 of 41
  • 146. Timing of Pages • AtEnd handler logs page requests with processing times 29 of 41
  • 147. Timing of Pages • AtEnd handler logs page requests with processing times <?LassoScript // Script written by Miles // http://tagswap.net/PageLogConsole define_atbegin({ var('start_time' = _date_msec); define_atend({ log_detail(response_localpath + ': ' + (_date_msec - $start_time)); } ); } ); ?> 29 of 41
  • 148. Page Optimization 30 of 41
  • 149. Page Optimization • AtEnd to remove extra whitespace http://tagswap.net/lp_page_trim (Bil Corry) 30 of 41
  • 150. Page Optimization • AtEnd to remove extra whitespace http://tagswap.net/lp_page_trim (Bil Corry) • Gzip compression of pages http://www.omnipilot.com/TotW.1768.8959.lasso (Fletcher Sandbeck) 30 of 41
  • 152. Protected Downloads • Set Lasso to process the download file type 31 of 41
  • 153. Protected Downloads • Set Lasso to process the download file type • AtBegin handler authorizes the download request 31 of 41
  • 154. Protected Downloads • Set Lasso to process the download file type • AtBegin handler authorizes the download request • If request is ok, use file_stream to serve the requested file 31 of 41
  • 155. Protection of .inc Files 32 of 41
  • 156. Protection of .inc Files • Make .inc files processed by Lasso in Web server 32 of 41
  • 157. Protection of .inc Files • Make .inc files processed by Lasso in Web server <?LassoScript define_atbegin({ if: response_filepath -> (endswith: '.inc'); $__HTML_REPLY__ = '<h1>Not authorized</h1>'; // set proper result code too abort; /if; } ); ?> 32 of 41
  • 159. Locking down SiteAdmin.LassoApp • To make from SiteAdmin.LassoApp can only be sure reached the server machine 33 of 41
  • 160. Locking down SiteAdmin.LassoApp • To make from SiteAdmin.LassoApp can only be sure reached the server machine <?LassoScript define_atbegin({ if: response_filepath -> split: '/' -> last -> (beginswith: 'siteadmin.') && response_filepath -> (endswith: '.lassoapp') && client_ip != '127.0.0.1'; $__HTML_REPLY__ = '<h1>Not authorized</h1>'; // set proper result code too abort; /if; } ); ?> 33 of 41
  • 161. URL Design 34 of 41
  • 162. URL Design • Disconnect the URL from the server’s file system 34 of 41
  • 163. URL Design • Disconnect the URL from the server’s file system • AtBegin lets us do URL mapping all within Lasso 34 of 41
  • 164. URL Design • Disconnect the URL from the server’s file system • AtBegin lets us do URL mapping all within Lasso • AtBegin has many other interesting uses 34 of 41