I'am working at the moment on a little PHP project.
For this, is created a simple router class which takes the value of a GET-parameter, splits it up and calls the requested class and method.
My .htaccess file should rewrite the requested url so I can call
which should be redirected to
So far so good. Thats working with the following .htaccess-file:
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?route=$1 [QSA]
But now, if I'am trying to access the base-URL
I'm getting redirected to
which I can't explain myself.
To be honest, I didn't worked a lot of with mod_rewrite until now but this behavior looks way to strange for me.
Hope anyone can help me.
Thanks guys.
Edit 2017-01-15
It looks like that it has nothing to do with the htaccess file.
At first I tested my file with this validator and it seems like it works like I wanted.
I tried to delete the htaccess file and I have still the same problem. So I assume that it is caused by the apache2 webserver.
I set the LogLevel in my virtual host to debug and got the following information from it:
[Sun Jan 15 09:33:41.684274 2017] [authz_core:debug] [pid 2183] mod_authz_core.c(809): [client 10.0.2.2:49743] AH01626: authorization result of Require all granted: granted
[Sun Jan 15 09:33:41.684355 2017] [authz_core:debug] [pid 2183] mod_authz_core.c(809): [client 10.0.2.2:49743] AH01626: authorization result of : granted
[Sun Jan 15 09:33:41.684445 2017] [core:info] [pid 2183] [client 10.0.2.2:49743] AH00128: File does not exist: /var/www/public/var/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.phpvar/www/public/index.php
It makes like no sense to my. My config-file for the virtual host contains no rewrite rules.