Page 1 of 1

Change name of index.php

Posted: Tue Jun 29, 2010 3:40 pm
by jondrew
Hi,

Hope someone can help I've installed cms made simple on a server where there is a current site already using index.php. This site will eventually be replaced by the one I'm building but for the time being the client wants to keep it up while we build the new site. So I need to change the name of the index.php file in cms made simple - I've done this (changed to index2.php) and installed it all and it all works fine apart from you can't navigate around the site because when you click on one of the pages it uses the query string index.php instead of index2.php - is there a way to change this?

Thanks for your help!!

Re: Change name of index.php

Posted: Tue Jun 29, 2010 3:45 pm
by calguy1000
No there isn't. 
The better mechanism to work with 'staging' sites is to put the install into a sub directory and then when time comes to move it live just move the files up one level and change the config.php and clear the cache.

Re: Change name of index.php

Posted: Tue Jun 29, 2010 3:49 pm
by jondrew
Ok thanks for the prompt reply. I've actually figured out a work around for the time being I've used this in the menu manager:

menutext}">{$node->menutext}

Basically hardcoding in the name of the page, I will then alter the menu manager once the site is up and running.

Cheers

Jon

Re: Change name of index.php

Posted: Tue Jun 29, 2010 3:52 pm
by calguy1000
That's only part of the solution.

You may have problems with links created by modules, and other plugins which all use a standard mechanism to create URLS.

Working in a subdirectory is the best solution.

Re: Change name of index.php

Posted: Tue Jun 29, 2010 4:09 pm
by jmcgin51
@calguy - I agree that separate development and production environments are the preferred way to go.

However, what do you think of adding a config variable in config.php, something like "$cms_index_page", where the user could force a sitewide homepage change?  For example, setting this variable equal to "index2.php" would then allow the core at least to use index2.php to build urls, etc.  Obviously 3rd-party modules would have to support this separately, and that would be up to the module developer.  I'm just thinking out loud, and there are probably reasons this is not a good idea...