Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add a simple txt file in router #71

Open
askyip opened this issue Nov 9, 2020 · 1 comment
Open

Unable to add a simple txt file in router #71

askyip opened this issue Nov 9, 2020 · 1 comment

Comments

@askyip
Copy link

askyip commented Nov 9, 2020

Hi dave,

I was trying to put a simple txt file for users to read when going on my test site websi.test.xyz/accounts.txt and it would say no route matched and print a stack trace of
#0 /home/askydipco/public_html/public/index.php(49): Core\Router->dispatch('accounts.txt')
#1 {main}
Thrown in '/home/askydipco/public_html/Core/Router.php' on line 136.
I tried to place it in App/Views/accounts.txt and just php-mvc main folder and tried to route it but it didn't work.
Can you help Dave? Thanks!

@daveh
Copy link
Owner

daveh commented Nov 10, 2020

Hi - you need to put that file in the public folder, so public/accounts.txt. You should then be able to access it at example.com/accounts.txt. If you have the framework in a subfolder, you need to include that in the URL: example.com/subfolder/accounts.txt

If you do have the framework in a subfolder, and it still doesn't work, you might need some additional .htaccess configuration. If so let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants