I'm haven't issue getting CodeIgniter 4 to work, I have other apps running on the same web server using CI 3.x without any issues. I have PHP 7.3.17 installed with IIS via FAST_CGI.
I can see the welcome message using this uri http://dev.com/CI-4.0.3/public/. When I try http://dev.com/CI-4.0.3/pages/showme I keep getting
HTTP Error 404.0 - Not Found - The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
What am I missing? Any suggestion is greatly appreciated.
I updated the $baseURL
in Config/App.php
to http://dev.com/CI-4.0.3/.
Created a controller Pages.php
with the following code:
class Pages extends BaseController {
public function showme($page = 'home'){
echo 'This page is '. $page;
echo view('templates/header');
echo view('pages/'.$page);
echo view('templates/footer');
}
}
In my Views folder I have a pages and templates folder with the following files:
My web.config looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Detailed Error Information:
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://dev.com:80/CI-4.0.3/index.php?url=pages/showme/home
Physical Path C:\inetpub\wwwroot\CI-4.0.3\index.php
Logon Method Anonymous
Logon User Anonymous
User contributions licensed under CC BY-SA 3.0