How do I run the code in the files I uploaded?


Hello Support!
I configured everything needed to be configured on my website with this account.
I uploaded all the files that work locally to the manager using FileZilla and it shows up in the online file manager.
however when I go to the url it is not showing anything different, it is pretty obvious since I did not direct it to my code, but I can not find anywhere to write to start the code at a specific file. in different cpanels I had a place where I could start the application and choose a start file and run it, yet I can not find it here. how does this work? where is it?


The htdocs folder is the root folder here. Make sure you have uploaded your files to the correct location.

Also, make sure that you have an index.html or an index.PHP file.


I did upload it to htdocs root folder.
I do not have an index.html since my website is using express for routes, thus the entry file is app.js which routes to the folder in which the display files are(in pug, which is like html)

i have found this guide to fix the problem of “index of /” that I am facing, however when I go to the advanced section of the cPanel, there is no icon with the title “indexes” and there is none, what should I do?

I tried researching the problem and found about .htaccess file, wrote one inside the htdocs to direct to the js file I am trying to run, and it simply sends it as text to the user instead of doing what it is supposed to do.
how can I fix this and run the code?

This code works on InfinityFree for redirecting the index path to a 403 if an index file does not exist.

I am not quite sure what you mean by that. Can you share the exact URL and the expected behavior?


You mean Express, as in the Node.js module?

Our servers don’t have Node installed, so Node apps and/or modules won’t work here, unless they also have a web distribution (Bootstrap is a good example) as well.

If you need to disable Directory Indexes, create (or edit) your .htaccess file and add:

Options -Indexes

the url for the website is,
I added that Options -Indexes to the .htaccess file, and then it says 403 forbidden.
how do I fix that?

That is what is supposed to happen. That means you don’t have an index file in that directory.


well, how do i fix it? I want app.js to be the starting file

I tried doing DirectoryIndex app.js but it does not run it, just sends it as text to the user

Why do you want a JavaScript file to be the index file? The file will not run the JavaScript code, it will just display it to the user. You need to create an index.html file that interacts with the JavaScript.

Also, when did you create the domain? It looks like the ns2 nameserver does not have the proper info for your domain.


Because that is what is supposed to happen when you directly access a JavaScirpt file. You need to call the file with HTML (See above reply)


but I am using express with node.js that is supposed to run at the beggining of the website

Our hosting doesn’t support Node.js, we only support PHP as a server side scripting language.

We do “support” Javascript, but only when it’s run in the browser, not on the server. Browser side Javascript can be triggered through HTML. And any file type which the server cannot execute (i.e. anything other than PHP) will just be sent as text to the browser where it’s up to the browser to decide what to do with it.


I did point that out earlier, you just neglected to read my reply.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.