Page not found (404) when application is called from a subfolder
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 381
- Forks
- 68
- Avg merge
- 1h 10m
- Merged PRs (30d)
- 1
Description
Description
I installed the latest app template in my ~/public_html/myproject directory. I put putenv('APP_ENV=dev'); in public/index.php (see issue #395). I request http://localhost/~xxxx/myproject/public from the browser and I get a 404 error.
If I change my Apache configuration and set as the localhost document root folder to the one as stated above (~/public_html/myproject/public), the application renders the page without issues.
It seems that this has something to do with the way the url is resolved from the framework. It should support installations under a subdirectory and not only in the root.
Package version
1.1.0
PHP version
8.2.30
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at public/index.php and reproduce the request under http://localhost/~xxxx/myproject/public with Apache, comparing it with the configuration that uses the project’s public directory as the document root. Trace how the application resolves its URL when served from a subfolder; done means the app renders correctly in both the document-root and subfolder setups.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- apache, php
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100