AngularJS relative url’s not working CPANEL
Note that if you’re using a simple server such as “http-server” or even something like “wamp”
without any configuration, the problem is normal.
Indeed, when you access the homepage, your “index.html” is automatically loaded, but if you access something like “http://url/part1”, the server will look for a folder “part1” that contains an “index.html”
page => error 404.
So you have to make sure base url like this /
and Make a htaccess file with code
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] </IfModule>
Share