Dup Goto 📝

Rewrite

PT2/linux/apache2/conf 10-27 08:22:25
To Pop
28 lines, 65 words, 465 chars Friday 2023-10-27 08:22:25

Enable

a2enmod rewrite

And in /etc/apache2/apache2.conf

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Example

RewriteEngine on

RewriteBase /obs

# END stops processing completely
RewriteRule ^boing$ boing.php [END]

# L stops this run and restarts
RewriteRule ^snarf$ boing [L]

# This will run for anything except starting with s except snarf
RewriteRule ^s(.*)$ snarf?$1