php-mvc icon indicating copy to clipboard operation
php-mvc copied to clipboard

Unable to add a simple txt file in router

Open askyip opened this issue 5 years ago • 1 comments

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!

askyip avatar Nov 09 '20 22:11 askyip

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.

daveh avatar Nov 10 '20 10:11 daveh