Welcome Guest, Not a member yet? Register   Sign In
URL rewrite for multiple applications on IIS
#1

[eluser]Unknown[/eluser]
I'm very new to CodeIgniter and I'm having problems with running multiple applications from one installation.
I have a live and a test application and I created the files live.php and test.php to use instead of the index.php file. For both of these files I changed the $application_folder to application/live and application/test respectively. The both also have their own config.php file and I've changed config['index_page'] to test.php and live.php.

CodeIgniter is running on an IIS server and I'm using an httpd.ini file. Originally when I was running only one application the file looked as follows:
Code:
[ISAPI_Rewrite]

#Add rules for folders you want to accept without rewriting:
RewriteRule ^/components/(.*)$ /components/$1 [I,L]
RewriteRule ^/images/(.*)$ /images/$1 [I,L]
RewriteRule ^/style/(.*)$ /style/$1 [I,L]
RewriteRule ^/css/(.*)$ /css/$1 [I,L]
RewriteRule ^/js/(.*)$ /js/$1 [I,L]

#This removes index.php? from the urls
RewriteRule ^/(.*)$ /index.php?/$1 [I,L]

This worked fine when I was running only one application but I had to change it in order to use the two new index files, live.php and test.php. I tried adding similar rules for test.php and live.php as the rule for index.php but I just kept getting the error that the page didn't exist so I had to leave it out. So now in order to access my application I have to type in the full path eg. http://www..com/test.php.

There is a login form on the landing page and the action of the form is '/dashboard/login/'. When I submit the form the URL omits the test.php and goes straight to http://www..com/dashboard/login/ instead of http://ww..com/test.php/dashboard/login/ and tells me the page doesn't exist.

I'm not sure why it keeps leaving off the test.php when I've removed the rewrite rule.
Do I have to change all my links and form actions to point to
Code:
'/<?php echo $this->config->item('index_page'); ?>/dashboard/login'
or is there something that I'm missing? Surely with no rewrite rule in place the default should be to include the index page automatically?

Any clarrification on this would be appreciated.




Theme © iAndrew 2016 - Forum software by © MyBB