1

I followed the steps outlined here. I copied and paste the code below in .htaccess file. The .htaccess file is in the same repository that contains my dist folder that I am going to deploy on apache.

RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]

# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html

When I access localhost/dist everything goes fine, since it will use my index.html file and it will automatically redirect to localhost/dist/login. Now if I request directly localhost/dist/login, apache complains and displays The requested URL /dist/login was not found on this server. It seems for me that apache does not picked up my .htaccess settings. Is there something I am doing wrong?

1 Answer 1

1

Finally I found a way to solve my problem. Maybe this could help some. I enabled the rewrite mode of Apache and instead of

RewriteRule ^ /index.html,

I wrote

RewriteRule ^ /dist/index.html

and this solved my problem.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.