File Path overwriting app
at my root is index.html with an app.js with embedded static yew wasm app (similar to React), which generates pages depending on the file path.
When I navigate to any url, it treats it like I'm trying to access a folder, rather than use the root directory's information. This worked in local development.
How do I just ignore trying file paths and just send it all to root?
-
Hey there! I'll be honest, I'm not entirely sure what is happening with this situation. My only recommendation to adjust URLs would be traditional .htaccess methods. Can you get me more details on what it means when you say "it treats it like I'm trying to access a folder" ? 0 -
Hey there! I'll be honest, I'm not entirely sure what is happening with this situation. My only recommendation to adjust URLs would be traditional .htaccess methods. Can you get me more details on what it means when you say "it treats it like I'm trying to access a folder" ?
The site is online actually, so you can see directly what I mean: REDACTED (root directory redirects to /pali/). I designed it so most pages load without refreshing, but if you refresh on any page that you have navigated to, like bran.blue/that/file/path, it'll end up in 404, because cpanel is trying to look in public_html/that/file/path as if it were a directory. And indeed in the converse, accessing REDACTED treats it like you're trying to access the actual assets folder I have (it gives a 403 instead of 404)0 -
Thanks for that, although I did edit your post since we can't share public info here. I'm honestly not sure as this sounds like it would be inside the application itself, as Apache just handles the domain how its told. 0 -
I solved it by adding this boilerplate to .htaccess RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule . /index.html [L]
0
Please sign in to leave a comment.
Comments
4 comments