Mod_rewrite to handle paths ?

I hope someone can help. I somewhat know what a mod_rewrite does which is URL rewiring. What I don't know is how to make the mod_rewrite to handle paths ?
Can this be why an AngularJS file is not being loaded ?

Normally web developers do not use mod_rewrite for routes in SPA web apps built on AngularJS, React or VueJS. They use Javascript libs like express.js or some other routing package for managing SPA routes

1 Like

Do the two tie in together ?

No.

We do not use mod_rewrite for SPA - style web apps.

The routes in an SPA web site is considered a single page, not multiple pages; and the routing is performed internally within the SPA using Javascript.

Express.js is a popular routing package, but there are others.

1 Like

I'm trying to run an app on my server, but that app requires access to a Angular.js file. Therefore, could it be because my mod_rewrite files is not setup to handle paths, that the Angular.js file cannot be access, causing the app not to load properly ?

No, it is not a mod_rewrite function when your web server cannot find the Angular.js library.

Your app cannot find Angular.js because you have not configured your app properly.

Did you build the app using node.js ?

Or did you build the app without using node.js ?

Please post your index.html file in your app (wrapped in CODE tags).

Thanks.

1 Like

I never built the app, someone else did; I only am trying to get it installed and that is what the author informed me is the problem.

Yes, and all Angular and Vue.js apps have index.html files. so please post it as I requested if you want help.

Thanks.

1 Like

What if I told you, honestly there is no index.html file ?

All Angular and Vue.js SPA apps should have an index.html file.

Without an index.html file, the web server cannot load the app.

So, then ... post the results of ls -l in the directory of your app.

I am sure you can do that :slight_smile:

Cheers.

1 Like

This is a result of ls -l

What happens when you try to build the app in that directory?

ng build --prod
1 Like
ng command not found

.

To install and view an Angular app on the web you must first build it.

This means you need to install node.js and then Angular .

Angular apps are then built using node.js .

Hope this helps.

How can I check if

node.js

is installed and if not; can it be installed by means of SSH ?

Just follow these instructions:

Angular - Getting Started

What is the command ng associated with; each time I try to run that command I get the error; command not found ?

To run an Angular app, you need to build it first.

To build it, you need to build it locally on your own machine, then upload it to your web server.

You are trying, or so it seems, to upload and run an Angular app to a web server without building it first.

So, you need to install node.js and Angular on your local system (not the remote web server) and then after you have node.js and Angular installed, you need to build the Angular app you want to deploy first. Then, after it is built, you can deploy it.

Please review the link above and study Angular before asking more questions about it. After you have read the "Getting Started" Angular docs and installed Angular on your desktop, then post back if you are still lost.

You seem to be trying to deploy an Angular app with zero knowledge or experience with Angular, without having Angular installed locally (on your desktop) and without understand the basics of how to build and deploy an app created to be developed, built and deployed with node.js.

You need to understand the basics about Angular first, so please review the link I sent you in my earlier post.

Thanks.

MaxtheCat,

I suggest you relax, enjoy a coffee, a beer, a glass of wine, or whatever you like and watch a few YT videos, for example:

The Net Ninja:

Node JS Tutorial for Beginners #1 - Introduction - YouTube

AngularJS Tutorial #1 - Introduction to AngularJS - YouTube

Traversy Media:

Angular Crash Course - 2019 - YouTube

Node.js Crash Course - YouTube

These tutorials will take you well on your way to understanding Angular and node.js. Thirty minutes of video tutorials will help you greatly (hours are even better) and are generally more useful, and often more entertaining, than watching a movie rerun on TV or a Netflix video.

You do not need to watch all of them or the entire series on one playlist if you do not want to learn Angular and Node, but you should at least learn the basics of what you are doing when you are installing an Angular application.

If you do not understand the basics, how can you build and deploy an Angular app?

From your posts, you seem be missing a basic understanding of what an Angular application is and how to build and deploy it. You are seemingly trying to deploy it without building it; and this is not now modern SPA applications are deployed. You must build the application using node.js, normally on your desktop, then deploy it to a web server (remotely).

Developers, like me, develop, build and deploy node.js apps like this continually, BTW. But we normally run node.js in dev mode before we build. All of that is described in the each of tutorials above. Just pick one and learn a bit about what you are trying to do.

I prefer Vue.js over Angular, but that's just my personal preference.

This is the instructions for installing the app, no where does it mention what you suggest;