Module 2: Matching requests to siteaccesses
A siteaccess is only useful when requests reach it. This module teaches every way the kernel matches a request to a
siteaccess, from the first part of the path to host names, host and path together, ports, and finally the redirect
that sends visitors of example.com/ to their language. All exercises use curl with a Host header, so no DNS
entries are needed.
At a glance
| Course | Multisite and site packages |
| Duration | 3 hours 45 minutes (with two 10-minute breaks) |
| Lessons | 4 |
| Level | Intermediate to advanced |
Lessons
| Lesson | Duration | What learners do |
|---|---|---|
| Lesson 2.1: Matching by URL path | 50 minutes | Predict which siteaccess answers an address; set PathPrefix |
| Lesson 2.2: Matching by host name | 55 minutes | Map a host to site_b, test with curl, use HostMatchMethod=start |
| Lesson 2.3: Host and path together, and matching by port | 50 minutes | Map host and path with HostUriMatchMapItems[], see why order matters, print the port defaults |
| Lesson 2.4: The redirect to the visitor's language | 50 minutes | Set up DefaultHostUriMatchMapItems[] and read the 302 and its cache headers |
Preparing this module
- Every learner has finished module 1: the siteaccesses
site_bandsite_b_geranswer at/site_band/site_b_ger. curlis installed where learners work (their computer or the lab server), and they know their lab's address.- The exercises change
MatchOrderand the host maps in the global override. That is fine with one installation per learner; on a shared training server, do lessons 2.2 to 2.4 as a demonstration on the projector instead. - Note the commands that undo each lesson (
exp:ini rem,exp:ini set ... MatchOrder uri), in case a learner wants a clean state, or reset the lab as in Lesson 2.6 of Train the trainer. - If labs run on Exponential Velocity, show once that every settings change needs
php bin/php/console exp:velocity restart.
Timing plan
| Part | Minutes |
|---|---|
| Lesson 2.1 | 50 |
| Lesson 2.2 | 55 |
| Break | 10 |
| Lesson 2.3 | 50 |
| Break | 10 |
| Lesson 2.4 | 50 |
| Total | 225 |
Related pages
- Multisite and site packages: course overview
- Trainers: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.