I have experience in running wordpress applications over IIS and it is very simple. After that I thought lets host the codeigniter application over IIS after that I found the error

codeigniter_404_not_Found

codeigniter application run on IIS

After doing some official websites R&D I found the following solution, here are the steps for solving following queries

  1. How to host codeigniter application over IIS windows server
  2. How to resolve 404 File or directory not found over IIS windows serve

Steps:

  1. Verify you have IIS installed on your windows server
  2. Verify you have installed URL_REWRITE module in your IIS
    iis_url_rewrite_module_codeigniter

    IIS URL Rewrite module

    You can download url rewrite module from there https://www.iis.net/downloads/microsoft/url-rewrite

  3. Add new website and add your codeigniter code in this website folder
  4. Click on website and in feature tab click on URL rewrite , this will open the following window

    import url rewrite rules

    Import URL Rewrite Rules

  5.  Add copy code form .htaccess file and paste into Rewrite Rules than click on apply button , this should be something like thisRewriteEngine on
    RewriteCond $1 !^(index\.php|images|public|assets|uploads|themes|install|updates|asset|mob|robots\.txt)
    RewriteRule ^(.*)$ index.php?/$1 [QSA,L]#<FilesMatch “\.(jpg|jpeg|png|gif|swf|css)$”>
    # Header set Cache-Control “max-age=604800, public”
    #</FilesMatch>

    Import_htaccess_rewrite_rule

    Import htaccess rewrite url

    Now you can check your website it should working fine and should not give you 404 folder not found error

ENJOY your day, for help feel free to fill contact form


2 Comments

codeonion · May 28, 2020 at 5:33 pm

Thanks you for this. I can use this in production and staging when we have to deploy PHP web applications.

Faustina Ode Austina · July 31, 2020 at 8:33 pm

It was fun to read your article. Faustina Ode Austina

Leave a Reply

Your email address will not be published. Required fields are marked *

back to top
Get Free Quote