views:

530

answers:

2

Hi,

We are developing a site using CakePHP. We have a windows IIS server (shared hosting) with PHP5, that does not support .htaccess or mod_rewrite but still we have the site up and running and developed a lot of things.

The current URL structure is something like this: mydomain/index.php/user/add

We want to change this to something like: mydomain/index.php?controller=user&action=add

We want to do this as we are facing some unexpected session expired problems and we doubt that it is due to the user travelling from one url to another like this: mydomain/index.php/user/add to mydomain/index.php/list/edit this change the domain for IIS or PHP which cause the session to expire, but cake is interpreting the pages perfectly.

If there is a way to change the behiviour of Cake to take the URL's with question and amphersand, it will be great.

Thanks in advance.

+1  A: 

You may want to try something like this:

1) point your IIS document root to app/webroot 2) Call your application by going to http://site.com/index.php?url=/user/add

As for changing it into controller=user&action=add, the only thing I can suggest is to add code to your index.php file to translate the "controller=user&action=add" format to the url=/user/add format. You may want to also check the Router to see if there are functions you can use to change these things around.

If you need more help, I'd post the question in irc.freenode.net #cakephp

Dooltaz
Thanks for your answer Dooltaz! It was useful.
happyhardik
A: 

session expiring is not caused by the url structure. have you check?

  1. Configure::write('Session.timeout', '3600'); in core.php. make it longer
  2. Configure::write('Security.level', 'high'); in core.php. make it medium or low
  3. Configure::write('Session.checkAgent', false); in core.php make it false. can cause problem with ajax calls
Funky Dude
Hi, I am not sure, if it is secure to reduce the security level from high to low or setting the checkAgent false. Can you point me to somewhere, where I can find what this security levels do and what will be the effect of it?
happyhardik
sounds like you need to read lines 130 to 147 in core.php (http://code.cakephp.org/source/app/config/core.php#123)
deizel
This worked out! We still have some problems but the basic problem is solved.
happyhardik