• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codeigniter 3 not working on iis

#1
Hello
am trying to run my website on iis but it only run the first page my is like this url http://localhost/friendmiiDemo/ and it works but when i go to http://localhost/friendmiiDemo/about it does not work i get this error https://www.dropbox.com/s/omltzinfskxpbey/Screenshot%20(49).png?dl=0 1


this is my web.config
Code:
<?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="{R:1}" pattern="^(index\.php|assets|images|js|css|uploads|favicon.png)" ignoreCase="false" />
                        <add input="%(REQUEST_FILENAME)" matchType="IsFile" />
                        <add input="%(REQUEST_FILENAME)" matchType="IsDirectory" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>


the first loaded page https://www.dropbox.com/s/qk38l9uoh5qvv1q/Screenshot%20(48).png?dl=0

and in the config i have these routes

PHP Code:
$route['posts/create'] = 'posts/create';
$route['posts/update'] = 'posts/update';
$route['posts/(:any)'] = 'posts/view/$1';
$route['posts'] = 'posts/index';
$route['default_controller'] = 'pages/view';
$route['(:any)'] = 'pages/view/$1';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE
i really don’t know what is wrong
my navbar code below
Code:
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
  <a class="navbar-brand" href="<?php echo base_url(); ?>">FriendMii</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav">
      <li class="nav-item active">
        <a class="nav-link" href="<?php echo base_url(); ?>">Home</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="<?php echo base_url(); ?>about">About</a>
      </li>
       <li class="nav-item">
        <a class="nav-link" href="<?php echo base_url(); ?>posts">Blog</a>
      </li>
    </ul>
    <ul class="nav navbar-nav navbar-right">
      <a class="nav-link" href="<?php echo base_url(); ?>posts/create">Create post</a>
    </ul>
  </div>
</nav>

Please help
Thanks in advance
Reply

#2
I have had success with the following:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <system.webServer>
       <defaultDocument>
           <files>
               <remove value="index.htm" />
               <remove value="Default.htm" />
               <remove value="Default.asp" />
               <remove value="iisstart.htm" />
               <add value="index.php" />
           </files>
       </defaultDocument>
       <rewrite>
           <rules>
               <rule name="Remove Index.php" stopProcessing="true">
                   <match url="^(.*)$" ignoreCase="false" />
                   <conditions logicalGrouping="MatchAll">
                       <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                       <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                       <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
                   </conditions>
                   <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
               </rule>
           </rules>
       </rewrite>
   </system.webServer>
</configuration>
Reply

#3
Thanks @jreklund it does not give me the error any more.. now it says (No input file specified.)
iis is stressing, i will keep trying to fix it but if you have any solution or an advice please help.
Reply

#4
I would check IIS error and access logs to find some more clues, that's a pretty generic error.

It can be miss-configured PHP Handler, read/write permissions on files etc.
Reply

#5
Note that a route with (:any) in it needs to be the very last route,
it is a catch all route.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#6
Good news it works i changed this <action type="Rewrite" url="index.php/{R:1}" appendQueryString="false" />
To this <action type="Rewrite" url="index.php?/{R:1}" appendQueryString="false" />
Reply

#7
and i fount this link with some solutions for this problem https://github.com/EllisLab/CodeIgniter/...ation-Tips
Reply

#8
GoDaddy strikes again it seems. Don't know why they are using that idiotic structure on their servers.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.