Skip to content Skip to sidebar Skip to footer

Using $locationprovider In Page Reload Doesn't Work

in case of eliminating # from address url , I tried to use $location provider in my router. at the first load changing root to another url works. but when I reload the new page it

Solution 1:

You should handle this at your server side (back end) Actually the request http://server.net/setting this way will take you to the webserver and your webserver does not reply you properly,

in appache and php index page I use something like this:

Header add Access-Control-Allow-Origin "http://localhost:3000"
Header add Access-Control-Allow-Credentials "true"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "GET, POST"
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]


<FilesMatch "\.php$">
Order Allow,Deny
Deny from all
</FilesMatch>
<FilesMatch "index[0-9]?\.php$">
Order Allow,Deny
Allow from all
</FilesMatch>

If you do not have access on your backend, you should use the hashtags, unfortunately

Post a Comment for "Using $locationprovider In Page Reload Doesn't Work"