L
L
Loony20212021-01-26 13:34:29
htaccess
Loony2021, 2021-01-26 13:34:29

How to make two entry points ( Vue cli + php )?

There is an api in the /api folder and there is a vue app in /public, is it possible to make all requests go to vue (/public/index.html) but if the request goes through /api, then it will go to /api /index.php I dug around the Internet, found a couple of articles, tried it, nothing happens.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Loony2021, 2021-01-30
@Loony2021

RewriteEngine On

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On
</IfModule>

<IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_URI} ^/api
    RewriteRule ^.*$  api/index.php$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f [OR]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ index.html
</IfModule>

But this rule does not ignore files, and the paths to the files are also redirected to index.html. Does anyone have any options?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question