help, cannot get "Static Pages" to work from the user guide :( - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: help, cannot get "Static Pages" to work from the user guide :( (/showthread.php?tid=77337) Pages:
1
2
|
help, cannot get "Static Pages" to work from the user guide :( - zoldos - 08-18-2020 I am working with the CI4 user guide. I'm beginning to see how things are routed, etc. However, I cannot seem to get the static page(s) to work. I followed the guide precisely as far as I can tell, but I get: "No input file specified" no matter what URL I select (except for the home page, as that loads the default Ci4 page, so I know everything is installed correctly, I assume). I am using everything on a live server with Apache, Ubunto 16, and PHP 7.3 and Plesk Obsidian. Here's my controller: Code: <?php namespace App\Controllers; And then I have the source files under: app/Views/pages and app/Views/templates But I can't make heads or tails of it. Help please! Thanks! RE: help, cannot get "Static Pages" to work from the user guide :( - jreklund - 08-18-2020 Are the folders "pages" and "templates" lowercase? As Linux can't find it if you created them as "Pages" and "Templates". (and the files themselves) RE: help, cannot get "Static Pages" to work from the user guide :( - captain-sensible - 08-19-2020 i just put my views in same directory as welcome_message and use this in a controller: $this->logic1= file_exists(APPPATH.'/Views/'.$page.'.php'); i'm also on Gnu/Linux (that keeps Richard Stallman happy )Slackware and using apache RE: help, cannot get "Static Pages" to work from the user guide :( - zoldos - 08-19-2020 (08-18-2020, 11:08 PM)jreklund Wrote: Are the folders "pages" and "templates" lowercase? As Linux can't find it if you created them as "Pages" and "Templates". Yes, those folders are lowercase as are the files. Strange, I don't get any 404 or anything, it just keeps saying "No input file specified" no matter what URL I try. RE: help, cannot get "Static Pages" to work from the user guide :( - zoldos - 08-19-2020 (08-19-2020, 07:38 AM)captain-sensible Wrote: i just put my views in same directory as welcome_message and use this in a controller: Cool. What file does this render? RE: help, cannot get "Static Pages" to work from the user guide :( - jreklund - 08-19-2020 "No input file specified" aren't a CodeIgniter error message, but a server error when I come to think about it. Can you show us how you created your virtual host in Apache? And what urls have you tried? RE: help, cannot get "Static Pages" to work from the user guide :( - captain-sensible - 08-19-2020 i just noticed something : Quote: is_file(APPPATH.'/Views/pages/'.$page.'.php')) the way i want my logic to work is : does that view exist; whereas your logic is : "is_file" RE: help, cannot get "Static Pages" to work from the user guide :( - zoldos - 08-19-2020 (08-19-2020, 12:58 PM)jreklund Wrote: "No input file specified" aren't a CodeIgniter error message, but a server error when I come to think about it. I tried: mysite.com/pages, mysite.com/pages/home, and mysite.com/pages/about What do you mean "virtual host"? I setup the domain in Plesk and uploaded all the files from the CI4 archive to the domain's root, being sure to change httpdocs to public. It seems to work, as mysite.com displays the default welcome page. I'm on a live server. (08-19-2020, 01:05 PM)captain-sensible Wrote: i just noticed something : I'm still confused. I may give this up. RE: help, cannot get "Static Pages" to work from the user guide :( - jreklund - 08-19-2020 Do mysite.com/index.php/pages work for you? In that case your .htaccess file aren't loaded. https://support.plesk.com/hc/en-us/articles/115003015833-Redirection-rules-in-htaccess-file-do-not-work-in-Plesk https://support.plesk.com/hc/en-us/articles/115001697373-Website-with-configured-htaccess-in-Plesk-is-not-working-404-Not-Found Virtual host are what point your domain to your website folder, it's an Apache term. As you said you used it. RE: help, cannot get "Static Pages" to work from the user guide :( - zoldos - 08-19-2020 (08-19-2020, 01:15 PM)jreklund Wrote: Do mysite.com/index.php/pages work for you? In that case your .htaccess file aren't loaded. This is my .htaccess file. mysite.com/index.php/pages works. It shows the default welcome page. .htaccess works fine for my other Plesk domains and I don't get 404. Note, I DO now get a 404 if I do: mysite.com/index.php/pages/home (I setup "my first app" by following the user guide): Code: # Disable directory browsing |