From the course: PHP: Clean URLs on Apache Server

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Linking to a specific part of a page

Linking to a specific part of a page - PHP Tutorial

From the course: PHP: Clean URLs on Apache Server

Start my 1-month free trial

Linking to a specific part of a page

- [Voiceover] In the example site, select Care for Orchids in the main navigation menu. The rewrite rule was created in the previous chapter, loads the page with a clean URL, rewrite/handp/care/orchids. At the top of the page are six links to specific parts of the current page. If you click one of them, it jumps to the selected section. And the URL in the browser address bar now has a hash and a section ID appended to it. This is known as an HTML fragment identifier and it's the normal way to link to a specific part of a page. But let's take a look at that rewrite rule that was created in the previous chapter. Go to the editing program, and here it is in .htaccess online 7. And the incoming pattern ends with orchids, followed immediately by a dollar sign. That means the pattern should reject any URL that contains anything appended after orchids. So why is the rewrite rule still working when we linked to a specific section in the page? It's because webservers ignore the HTML fragment…

Contents