Hi,
I’m a ModX ’newbie’ but I have used the ModX system before that someone else setup for me and now I want to install it on a server for a commercial project that I am working on.
The server is your standard Linux/MySQL (LAMP) server. Not sure of versions etc but pretty up to date (is via a very well known hosting provider).
I have read the installation instructions for ModX and it all seems well and good but what do you do when you are installing alongside an existing web application? The project is to basically rework the old application into ModX so that it is more user friendly and extendable (right now it’s very ’old school’ and a nightmare to code).
So the questions that I have specfically are:
1) What do I do when there is already an index.php file in the public_html folder? This will mean that I can’t install ModX in the public_html folder right? What are my options (either rename the index.php to something else like index_old.php and have the ModX system to redirect the user to that file every time that someone types our domain name into the brower?) Any other ideas?
2) If I install ModX into the a seperate folder (e.g public_html/modx or some such folder) is ModX able to access files that are in the directory below it? For example ... say I want to create a new page within ModX called mypage.html and I want that to be in the document root (i.e www.mydomain.com/mypage.html) is this still possible even if ModX is installed in a directory below that (like the public_html/modx directory)?
Basically eventually I want all existing Php files and templates integrated and cotrolled by ModX, but I must keep the existing ’old school’ application running and manage the transition without any disruption to the existing service.
Really appreciate your help,
Peter
Here are the two most common methods of dealing with the situation:
1. Install MODx on your local machine using XAMPP. When it’s working, backup and delete the current site and copy the new MODx site to the root and do an upgrade install.
2. Install MODx in a subdirectory. After it’s working, back up and delete the current site, move MODx to root, and do an upgrade install.
Hi,
thanks for your response.
So I don’t think 1) is an option as it’s going to be a long time before the new app is finished and we need the 2 to run alongside each other in the meantime.
With Option 2) - Can I still create web pages that will appear as though they are in the root (public_html) directory? I was concerned that I would only be able to create files in the public_html/modx directory (or whatever I named the install directory)
Thanks
Peter
The two sites can’t have the same URL at the same time. With the MODx site in a /modx subdirectory, you’d reach the original site with yoursite.com and the modx site with yoursite.com/modx. That’s a piece of cake.
I believe you could also have rewrite ruls in an .htaccess file in public_html that would let users reach the MODx site with yoursite.com. Commenting out those rules would turn the old site back on. I’m not that great at rewrite rules so I’m not sure what the best way to do that would be.
Hi Bob,
thanks for you reply.
I think the best solution is probably to rename the current index.php file to something like index1.php, and then make the root page in ModX a simple HTML redirect to index1.php .
This way I don’t have any hassle with upgrading later on or having to change directories, which let’s face it, is a hassle.
I thought there might of been a chance though that we could have installed it in a sub-dir but still had access to the root directory but I guess not.
Cheers
Peter
-
MODX Staff
- 12,272 Posts
MODx will not work without an index.php file (i.e., renaming it index1.php will break it).
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me