httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject [users@httpd] webserver configuration to redirect correctly API calls
Date Tue, 13 Mar 2018 07:51:32 GMT

I have to admit that I am a total amateur concerning apache and its configuration. However,
I am in the need to do so. In order to use an API to add data into an application which is
running in apache2 I need to set a redirection.

Everything what I found by now does not really help me, probably also as I do not know the
syntax in detail and which files are really important.

I have the Info how this redirection works in Nginx:
location ~ ^/api/v1/(.*)/?$ {
rewrite /api/v1/(.*)$ /app/controllers/ApiController.php?req=$1? last;

In words what the redirection needs to do is that all requests that go to /api/v1/BLAH are
redirected to /app/controllers/APIController.php?=req=BLAH

The "home" directory is: /var/www/html/elabftw
and the API stuff is in /var/www/html/elabftw/app/controllers/

I tried already something like that:
- creating a .htaccess file in /var/www/html/elabftw/
- adding:
RewriteEngine On 
RewriteRule ^/api/v1/(.*)$ /app/controllers/ApiController.php?req=$1? [R=301]

..but it does not work...

I would be very happy and thankful for help - in which file (.htaccess??), do I need to write


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message