help, cannot get "Static Pages" to work from the user guide :( |
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!
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 (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. (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?
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" (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.
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/artic...k-in-Plesk https://support.plesk.com/hc/en-us/artic...-Not-Found Virtual host are what point your domain to your website folder, it's an Apache term. As you said you used it. (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 |
Welcome Guest, Not a member yet? Register Sign In |