0

I have an application written in Codeigniter 2.1.4 which works on my local machine installed with WAMP.

When moving the project over onto a production server, Codeigniter routing stops working. The login form actions a controller method, but instead I get routed to the home page of the website. The same happens if I manually try to enter any part of the web app, even though I have redirect logic for not being logged in to the app.

My production server has IIS6 installed and IsapiRewrite4.

I've tried copying all the rewrite rules from the .htaccess file that comes with CodeIgniter into an IIRF.INI file but I just can't get it to work.

These are the default .htaccess rules:

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

I've read that you can paste that into an IIRF.INI file and it should work but had no luck with it.

Also, I'm not exactly sure where to put the IIRF.INI file, I was guessing at the CodeIgniter root directory where the other .htaccess is.

I also noticed that there are other .htaccess files, one in the /core folder, one in the /application folder, and one in the /application/cache folder.

Do I need to restart IIS on the production server when changing/adding IIRF.INI files?

I've also tried the rules suggested here with no luck: Configure htaccess to work with IIRF on IIS6 - codeigniter

Can anyone help??? Maybe it's not even a Rewrite Issue, I'm not sure... Please let me know if you need any other information.

Community
  • 1
  • 1
projeqht
  • 3,160
  • 3
  • 18
  • 32

1 Answers1

2

Isapi Rewrite is a product by Helicon Tech. Helicon products use slightly different configuration files to Ionic IIRF isapi rewrite module which uses the IIRF.ini files. I think you've got your products mixed up.

See Helicon's documentation at http://www.helicontech.com/isapi_rewrite/

Alternatively Ionic ISAPI rewrite module is available at https://iirf.codeplex.com/

Andy Davies
  • 1,456
  • 9
  • 13