Search Posts

Category: html5mode

Cannot point to the right bundles because of the base

I have a mean-stack website, and in index.html I have <base href=”/1/” />. I am trying to follow this to integrate the ESM version of the Monaco Editor by using plain webpack. I can successfully generate all the bundle files in dist folder. Now, in app.js I add app.use(express.static(path.join(__dirname, ‘dist’))); and in index.html I add <script src=”/app.bundle.js”></script>. As a result, loading the webpage loads well http://localhost:3000/app.bundle.js which points well to the right file. However, when […]

AngularJS about page with html5mode page refresh error [duplicate]

This question already has an answer here: Reloading the page gives wrong GET request with AngularJS HTML5 mode 26 answers AngularJS – Enable HTML5 Mode Page Refresh Without 404 Errors 3 answers I am using w3schools route example to make a simple website. my project folder is wamp/www/angular/7 and base href=”/angular/7/”. But when I refresh my page on angular/7/red page refresh shows NOT Found. Kindly advice or correct my mistake, following is the code. <!DOCTYPE […]

Does setting html5Mode to true no longer make my website a single page application?

In AngularJS if you want to get rid of the ‘#’ in the url, you set html5Mode to true. But then this sends a request to the server for the page, no longer making it a single page application, is this correct? The way I can tell this is because when I comment out setting the html5Mode to true, the ‘#’ is in the url and my website works as a single page application. But […]

angular .htaccess 404 for html5mode

I am trying to make my urls looks like localhost/CLCAppV2/client/register rather than looking like ocalhost/CLCAppV2/client/index.html#/register So I configured my .htaccess like <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.html/$1 </IfModule> I then configured my angular config to look like $urlMatcherFactoryProvider.caseInsensitive(true); $locationProvider.hashPrefix(”); $urlRouterProvider.otherwise(‘/register’); $locationProvider.html5Mode({ enabled: true, requireBase: true }); I also have my html base url set in the index.html as <base href=”/CLCAppV2/client/”> My current folder structure looks like […]