I have the following code in my .htaccess file, placed in the root of my Ubuntu 22.04 instance:
Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^profile/([^/]*)$ /profile.php?user=$1 [L] My goal is to use:
example.com/profile/johndoe
to get the following output URL:
example.com/profile.php?user=johndoe
but it doesn't work :(
mod_rewrite is on
My apache2.conf looks like this:
<Directory /> Options FollowSymLinks AllowOverride All Require all granted </Directory> <Directory /usr/share> AllowOverride None Require all granted </Directory> <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> <Directory /var/www/html/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> I don't know what I'm doing wrong, any help will be greatly appreciated