Running Concrete5 outside of a sub-directory install
PermalinkFor the most part it works. It even installs even installs from the c5.php location. What doesn't work without any modifications to the Concrete5 install is the administration, links in search, form posts and logins. Everything works normally when accessing Concrete5 via the sub-directory that it's installed in.
<?php if(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) { $protocol = "https"; } else { $protocol = "http"; } define('BASE_URL', $protocol.'://' . $_SERVER['HTTP_HOST'].'/c5'); define('ASSETS_URL_WEB', $protocol.'://'.$_SERVER["HTTP_HOST"].'/c5'); define('DIR_BASE',$_SERVER["DOCUMENT_ROOT"].'/c5'); define('DISPATCHER_FILENAME', basename($_SERVER["SCRIPT_NAME"])); define('REDIRECT_TO_BASE_URL', false); #define('DIR_REL', $_SERVER["SCRIPT_NAME"]); define('DIR_REL', '/c5.php'); define('DIR_REL_LINK', '/c5.php'); if ($_SERVER["REQUEST_URI"] != DIR_REL && $_SERVER["REQUEST_URI"] != DIR_REL."/" && file_exists(str_replace(DIR_REL,".". BASE_URL, $_SERVER["REQUEST_URI"]))) {
This code hasn't been tested on the destination server, but works on a localhost Zend Server CE install.
I know that something similar to this can be done with .htaccess settings, but the host(Yahoo) I'm working on this for doesn't have that available to me.
I have been digging through the Concrete5 code trying to fix links that do not work properly with my script, and I have found numerous instances of repeated code that could be defined by a much shorter variable.
DIR_REL . '/' . DISPATCHER_FILENAME
and
BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME
These output "/c5.php/c5.php" and "/c5/c5.php/c5.php" respectively. If those 2 parts of code were replaced with a variable defined in concrete/config/base.php my method could be implemented rather easily. I am working on it, but I can't help thinking I'm going about it the wrong way.
Has anyone done something similar and got the administration to work without vast modifications to the Concrete5 installation?
This has been my first day of working with Concrete5, and searching hadn't turned up an answer.

"Yahoo! does not currently allow you to upload .htaccess files to your account."
This isn't the ideal situation for hosting, and I'll probably move the Concrete5 install to the web root directory anyways. This was just something I saw it as a challenge that someone else might have faced.
The default themes did appear to have missing images and menus, but that also happened on a default install, so I am not blaming my modifications.
I will continue testing and write up some documentation on my modifications, and post them here.