0

Hello I removed the # in the url and it's good, but as I refresh the page I get an error:

500 Internal Error

The server encountered an internal error and could not complete your request.

I have set in the app.config:

$locationProvider.html5Mode(true);

in index.html:

<head>
<base href="/">
</head>

and in .htaccess:

RewriteEngine On
Options FollowSymLinks

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /#/$1 [L]

How to fix it?

1 Answer 1

2

At first I'm telling you that this is the same problem which I had faced some days ago. In the following there is a couple of steps which you have to maintain

step 1: you have to set base url like after starting the head tag in the top of your main index file. If you are not in the root then you have to set the path as follows

step 2: your .htacces file will be this

RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
RewriteRule ^ /your-folder-name-here-if-you-are-not-in-the-root/index.html

step 3: in app.config where you set your route there paste this code

$locationProvider.html5Mode(true);

I think that's it

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.