When rewriting the URLs for my MVC style application with RewriteRule(s) in my .htaccess file I am having a problem with the URL getting longer and longer. There you can find a (not) working example: https://rossi.klingt.org/new/
I've tried several rewriting rules i found here like in this question
I'm running:
Linux 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5 (2019-06-19) x86_64
PHP Version 7.2.9-1
Can't get the exact Apache version
The code I'm using in my .htaccess file in the folder /new/ at the moment is this:
<IfModule mod_headers.c>
Header always append X-Frame-Options SAMEORIGIN
Header set X-XSS-Protection "1; mode=block"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /new
RewriteCond %{REQUEST_URI} (^|/)\.htaccess$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (^.*) index.php [L]
</IfModule>
If you click a link, it will be added to the end of the URL. I expected it to behave differently. I did a similar thing on a pretty old system and it only kept the last folder and did not add them up.
What am I missing? Any help would be appreciated! Thank you all!!