Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 16449

404 Occurrence Problems When Deploying a react project to Apache

$
0
0

If you build a small project that you made after learning the react for the first time, upload files and folders to the Apache server, and access them

Unexpected Application Error!404 Not Found

It will be output.

The access address type is

http://Ipadress/userid

When first built, the main.js and main.css paths are

http://Ipadress/static/css http://IpIpadress/static/js 

I couldn't find the exact path because I was caught, so I created an .env file through a search

PUBLIC_URL = http://ip/userid

After you create it, rebuild it, and then go to the Olini path normally

The screen has the same error as the first one.

​What I tried searching is in the public_html folder

.htaccess<IfModule mod_rewrite.c>RewriteEngine OnRewriteRule ^index\.html$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^ index.html [QSA,L]Require all granted</IfModule>

and created it for me

The apache setting is

<Directory "home/users/*/public_html">    AllowOverride FileInfo AuthConfig Limit    Options MuliViews SymLinkIfOwnerMatch IncludesNoExec    Require method GET POST OPTIONS</Directory>

It is set to .

Additionally, I'm using reacr-route-dom, but it's not in the form of a page

There is no place to apply url because it is simply set as layout,

route.jsconst router = createBrowserRouter([  {    path: "/",    element: <Head />,    loader: ScheduleMainLoader,    children: [      {        path: "/",        element: <ScheduleMain />,        //loader: ScheduleMainLoader,      },    ],  },]);
App.jsxconst App = () => {  return (<AppProvider contexts={[CommonProvider, ModalProvider]}><RouterProvider router={router} /></AppProvider>  );};

Additionally, if you click index.html on the network, in the preview

You need to enable JavaScript to run this app.

It's being printed as above, but is it originally being printed?

Please give me some tips or know-how.


Viewing all articles
Browse latest Browse all 16449

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>