Skip to main content

File Path overwriting app

Comments

4 comments

  • cPRex Jurassic Moderator
    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
  • branzz
    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
  • cPRex Jurassic Moderator
    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
  • branzz
    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.