public_html中的两个索引文件

I have a web app where once the user logs in he is directed to a profile page. While building the front end I created both a login form and profile separately with its individual CSS and JS files in separate folders. Now while uploading to the server, the profile page is not able to access its CSS and JS files. This is how the files look like after uploading in the server:

enter image description here

The index file in the pic is the index of the login page. I have the profile folder which contains all the CSS and JS files of the profile page. Its index file I have taken outside and named it profileindex.php. All the paths in the profileindex.php looks like this :-

<link href="public_html/profile/css/style.css" type="text/css" rel="stylesheet" media="all">

The location tag from the authentication page is pointing to the profileindex.php:

header('location: profileindex.php');

Please help as I am not able to access the CSS and JS of the profile page as expected. After login I can only see the profile page with its HTML components.

Your link is incorrect.

Remove the public_html like so to use a relative path

<link href="profile/css/style.css" type="text/css" rel="stylesheet" media="all">

I think you should remove public_html from the path as profileindex.php is already in this folder.

<link href="profile/css/style.css" type="text/css" rel="stylesheet" media="all">
<link href="public_html/profile/css/style.css" type="text/css" rel="stylesheet" media="all">

This line looks for style.css file inside your current folder/public_html/profile/css/style.css.

Actual code should be:-

<link href="profile/css/style.css" type="text/css" rel="stylesheet" media="all">

This will look in current folder/profile/css/style.css. Please Read about Absolute and relative paths here

Remove the public_html/ from this

<link href="public_html/profile/css/style.css" type="text/css" rel="stylesheet" media="all">