D
D
Dmitry Baskakov2019-09-13 03:20:32
htaccess
Dmitry Baskakov, 2019-09-13 03:20:32

Why doesn't RewriteRule work in Apache?

RewriteEngine On
RewriteRule ^/api/v1/(\w+)$ /web/api/v1/$1.php [L,NC]
RewriteRule ^(|/)$ /web/catalog.php [L,NC]
RewriteRule ^(\w+)$ /web/$1.php [L,NC]

It is necessary that when going to 192.168.1.36:8181/api/v1/getProductCount , the file located along the path 192.168.1.36:8181/web/api/v1/getProductCount.php is taken , but this does not happen. What's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-09-13
@dodo512

RewriteRule ^/api/v1/(\w+)$ /web/api/v1/$1.php [L,NC]

https://habr.com/en/company/sprinthost/blog/129560/
So in the template you need to change ^/apito^api

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question