I'm pretty new to building web applications and programming in general. I have a Reactjs web application that I host from a home server. I own a domain name on GoDaddy. I am forwarding that domain to my app.
The Issue: When viewing the app via the domain name, the URL does not change when moving between pages.
Goal: When viewing the app via the domain name, I would like for the URL to change to the appropriate page when navigating.
When I view the app from the local network, the pages appear in the URL appropriately.
Is there something on the web side that I need to do, or is this a coding issue? I'm using react-router-dom. I've posted the basic structure below.
<BrowserRouter>
<Navbar />
<div className="container" style={{ marginTop: 40 }}>
<Routes>
<Route exact path="/" element={<Home/>}/>
<Route exact path="/shop" element={<Shop productData={this.state.productData} showAllProducts={this.showAllProducts} addToCart={this.addToCart} showCart={this.showCart}/>}/>
<Route exact path="/about" element={<About />}/>
<Route exact path="/login" element={<LogIn authenticate={this.authenticate} />}/>
<Route exact path="/signup" element={<SignUp registerUser={this.registerUser} />}/>
<Route exact path="/profile/cart" element={<Cart user={this.state.user} showCart={this.showCart} productData={this.state.productData}/>}/>
<Route exact path="/profile" element={<Profile user={this.state.user} viewProfile={this.viewProfile}/>}/>
<Route exact path="/admin" element={<Admin isAdmin={this.isAdmin} />}/>
</Routes>
<Routes>
<Route exact path="/shop/personalized" element={<Personalized productData={this.state.productData} showProductsByDesign={this.showProductsByDesign} addToCart={this.addToCart}/>}/>
<Route exact path="/shop/nonpersonalized" element={<NonPersonalized productData={this.state.productData} showProductsByDesign={this.showProductsByDesign} addToCart={this.addToCart}/>}/>
<Route exact path="/shop/allproducts" element={<AllProducts productData={this.state.productData} showAllProducts={this.showAllProducts} addToCart={this.addToCart}/>}/>
<Route exact path="/images/checkAddress" element={PersonalizedPencilPouch}/>
</Routes>
</div>
</BrowserRouter>
Any help would be greatly appreciated.