DEV Community

Discussion on: Deploy / Host your React App with cPanel in Under 5 Minutes

Collapse
 
abelardoit profile image
abelardoit • Edited

Hi there,

The tutorial I searched for.

  1. My domain is "aaaaaaa.com".

  2. I modified the package.json by including the "homepage" line pointint out to "aaaaaaa.com"

  3. I run "npm run build". It created the build folder inside my React app.

  4. I connected to my cpanel user. I opened the File Manager. Under my "public_html" folder I created a folder called "chat".

  5. Inside this folder "chat" I uploaded the content of my build folder, including my static folder which contains both folder css and js (and their files).

6.a I modified the "public_html/.htaccess" file to add the content you shared with us.
6.b I modified the path to "index.html" to be pointed out to the "index.html" inside my chat folder:

RewriteEngine On
RewriteBase /
RewriteRule ^/chat/index.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /chat/index.html [L]

  1. I went to the "aaaaaaa.com" webpage.

  2. I couldn't directly see the chat. Instead, at "localhost:3000" I can directly see the chat.

It's clear I made a mistake but I don't know where I made it.

Could you gently help me, please?

Best regards.

Collapse
 
abelardoit profile image
abelardoit

When I load "aaaaaaa.com/chat" this message is showed at the console tab:
Uncaught SyntaxError: Unexpected token '<'
Can this message explain us why my chat is not seeing?