This is my original .htaccess file. The rewrite rule works fine:
RewriteEngine On
RewriteBase /backenddev/
RewriteRule ^share/([ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijklmnpqrstuvwxyz123456789]{8})$ share.php?token=$1
But after moving the RewriteBase part into Apache's site conf file and restart Apache, it doesn't work anymore.
The new .htaccess file with the rewrite rule only:
RewriteRule ^share/([ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijklmnpqrstuvwxyz123456789]{8})$ share.php?token=$1
And the Apache site conf file:
Alias /backenddev "/var/www/backend_dev/"
<Directory /var/www/backend_dev/>
Options FollowSymLinks
RewriteEngine On
RewriteBase "/backenddev/"
AllowOverride All
...
</Directory>
When I open the URL https://<mysite>/backenddev/share/XV6TqNpE I get an 404 and the site content is:
The requested URL /var/www/<mysite>/backend_dev/share.php was not found on this server.
A redirection to https://<mysite>/backenddev/share.php?token=XV6TqNpE is expected.
Any ideas why it doesn't work?