React Routes not working when deploying the website to ftp server

Viewed 20

I am trying to deploy my react project to ftp server.I've build the project with npm run build and copy pasted build folder to ftp server. I can see the main page of website but when i try to go to links it cannot find the page and giving 404 not found page error. Here is my app component with routes .`

function App() {
    return (
        <main className="page-container">
            <Router>
                <Header />
                <Basvurubutton />
                <Announcement />
                <Routes>
                    <Route path="/" element={<Anasayfa />} />
                    <Route path="/dayanisma" element={<Dayanisma />} />
                    <Route path="/iletisim" element={<Iletisim />} />
                    <Route path="/hizmetlerimiz" element={<Hizmetlerimiz />} />
                    <Route path="/sorular" element={<Sorular />} />
                    <Route path="/basvuru" element={<Basvuru />} />
                    <Route path="/popup" element={<Popup />} />
                </Routes>
                <Footer />
            </Router>
        </main>
    );
}
0 Answers
Related