# Block direct access to sensitive file types
<FilesMatch "\.(phtml|phpm|inc|sql|log|bak)$">
    Require all denied
</FilesMatch>

# Do not list the contents of folders without an index file
Options -Indexes

# Custom error pages
ErrorDocument 404 /phpbook/ch22/notfound.php
ErrorDocument 403 /phpbook/ch22/forbidden.php

# Pretty URLs: /phpbook/ch22/product/25 -> product.php?id=25
RewriteEngine On
RewriteBase /phpbook/ch22/
RewriteRule ^product/([0-9]+)$ product.php?id=$1 [L,QSA]
