EDIT:
The default installation of Apache2 on a Ubuntu system seems to be completely locked down. This also affects the .htaccess files as these aren’t allowed to overwrite anything from the default configuration.
However, editing the /etc/apache2/sites-available/default file did grant my .htaccess files enough privileges to do what I wanted to do:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
# Modify this from "None" to "All" (or any other suitable value)
--> AllowOverride None
Order allow,deny
allow from all
</Directory>
...
EDIT:
This is what my .htaccess looks like as of now:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/(.+)$ $1-$2.php
ORIGIN:
I found several how-to’s about this but I can’t get it right (Yes, I’m that tragically stupid).
I would like to translate this:
http://www.mydomain.com/flat/link?a=b&c=d
To this:
http://www.mydomain.com/flat-link.php?a=b&c=d
As of now I only get a stupid 404 complaining about The requested URL /flat/link was not found on this server.
Worth mentioning is that the 404 actually is right; there is no file-structure like /flat/link in the www-root, hence I will translate a fictional path to an actual one (as the flat-link.php file exists). I’ve been told that this isn’t necessarily the most beautiful architecture but it is a valid scenario as I don’t want my file structure to match my REST-api.
.*matches everything, try making it less greedy by appending a?to it:If this does not work, try matching everything except for a slash: