Skip to content
Advertisement

My Routing.php doesnt work properly after switch from nginx to apache

I am working on a small project on my local machine (in a nginx docker container) and I today was the first time when I uploaded it to my webserver and found out that it’s an apache server.

Everything works fine, except for my router.php.

When I visit example.com/admin I get an error 404 on my apache server but in my nginx docker container I am getting the correct page though.

I am getting AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. in my error_log_apache

JavaScript

Since it probably has something to do with the configs, and I have to idea what exactly, I’ll give you my default.conf which is the config for my nginx server.

JavaScript

and here is my untouched httpd.conf from my apache server Edit: Apparently I have to rights to change the httpd config

JavaScript

Advertisement

Answer

You have to add a .htaccess file on the root of your project.

JavaScript

For this you need to enable rewrite module for apache you can do this for by running sudo a2enmod rewrite after this you need to restart apache server sudo service apache2 restart

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement