Hide the subdirectory URL

Okay, so I've gone through all 136 pages on this forum. I still haven't found a total solution, even though I'm pretty sure my problem is fairly common. Basically, I have installed concrete5 to a subdirectory /cms under the directory I am using for my root. I want my URLs to not show the /cms. I know that my .htaccess is set up properly for this, now my only problem is that concrete5 keeps re injecting the /cms into all the links, probably due to the DIR_REL variable in site.php.

So what I'm looking for is:
1) install concrete5 in a subdirectory, /cms
2) force concrete5 to act like it is installed at root with a blank DIR_REL
3) pretty urls

To make things more complicated I'm using bluehost which is notorious for not putting the main domain under its own subdirectory, and I have to use .htaccess hackery to make a directory under the root act like it was the root. I'm pretty sure that this means I have to merge the .htaccess in the document root with the suggestions for pretty URLs since the requests are actually hitting the document root first, and then getting rewrites to the actual subdirectory the site is in.

I'm pretty sure that my .htaccess is right in this case.

So the actual directory structure to concrete5 is /public_html/*fakeroot*/cms/(concrete5files)

and again I want concrete5 to act as if the cms part of the path is not there at all.

All right, finally figured it all out. You do have to use the hack on request.php the earlier link I posted contains in order to keep concrete5 from looking up the wrong path even when everything is set correctly in .htaccess and DIR_REL is set to empty.

However after doing that css/images/god knows what else will be broken. The reason for this is that most things are generated by concrete5 dynamically through the index.php file, but a few things are actual static files that exist under the directory structure. The usual .htaccess rules will rewrite the urls for the static resources to go through index.php like everything else, and concrete5 will be hitting the database expecting to find content instead of letting the server find the static files. A good way to illustrate this is to try to pull up the url for the concrete5 logo in the upper left hand directly (which should be missing if this is happening to you, but you should still be able to right click and grab the url) and you'll see that instead of getting a server 404 page you get a concrete5 specific 'page not found' error which indicates that index.php actually tried looking for content in the database and of course failed.

To fix this you need to add two lines to .htaccess to exclude anything that already exists first. This should go before your rule that rewrites calls to the index.php, wherever it's located,

#Concrete5 serves static things out of its own directory,#We don't want to go through index.php in those cases.
RewriteCond %{DOCUMENT_ROOT}/<path to concrete>/%{REQUEST_URI}!-f
RewriteCond %{DOCUMENT_ROOT}/<path to concrete>/%{REQUEST_URI}!-d

But this is only good enough to ignore static files that exist. You need a new rewrite rule as well to fix the url if you're hosting concrete5 out of a subdirectory (or two)

it was'nt in the subdirectory I was looking for :
- \www\conc\concrete\libraries <-- is good
instead of
- \www\conc\libraries <-- is wrong :o)

Now, I did the updates, however I face some changes regarding the look : The page where I defined a layout of the via blocks has lost its structure and the "expand and colapse" block of the marketplace doesnt work any longer : they are displayed open and can't be close despide the setting.
In addition the administration has disapear !!

- any idea where I have to look to fix this ?

Beside this,
I'm using iframe block with an external gallery generated by jAlbum inside. Of course this dosent work any longer. I'll have some DIY in www\.htaccess to do I suppose ?

,.-~*´¨¯¨`*·~-.¸-(_NEWS NEWS _)-,.-~*´¨¯¨`*·~-.¸

After many test at the limits of my skills (!) I reinstall C5 elsewhere, then the themes (rigidlight) and addons. Finally I import the database (some pictures has gone) and this stands as I wish....
As if the theme and addon didnt support to have the directory changed after being install which would be very surprising... any exlanation ?

Thanks so much for posting this. I have a client on Bluehost where we want to put the main domain in a subdirectory and I *almost* have this working.

EDIT: it's working. I had neglected to update the subfolder name in site/config.php

That said, in /SUBFOLDER/(updates/concrete5.5.2.1/)concrete/libraries/required.php the parsePathFromRequest function has changed, putting the DIR_REL in a switch statement:

privatestaticfunction parsePathFromRequest($var){$path=(isset($_SERVER[$var])) ? $_SERVER[$var]:@getenv($var);if(!$path){returnfalse;}switch($var){case'PATH_INFO':// DIR_REL not in path; do nothing.break;case'REQUEST_URI':$path=str_replace($_SERVER['QUERY_STRING'],'',$path);$path=trim($path,'?');default:// if the path starts off with dir_rel, we remove it:if(DIR_REL !=''){// this would be changed to DIR_REL2

privatestaticfunction parsePathFromRequest($var){$path=(isset($_SERVER[$var])) ? $_SERVER[$var]:@getenv($var);if(!$path){returnfalse;}switch($var){case'PATH_INFO':// DIR_REL not in path; do nothing.break;case'REQUEST_URI':$path=str_replace($_SERVER['QUERY_STRING'],'',$path);$path=trim($path,'?');default:// if the path starts off with dir_rel, we remove it:if(DIR_REL !=''){// this would be changed to DIR_REL2$dr=trim(DIR_REL,'/');// this would be changed to DIR_REL2$path=trim($path,'/');if(strpos($path,$dr)===0){$path=substr($path,strlen($dr));}}break;}

Here is yet another way to do this that just adds a single modified index.php to your site, without changing .htaccess:
Install to a Subdirectory, Run from root (without patches or .htaccess)http://www.concrete5.org/?cID=612245...

Does anyone know if there is a working link to this solution? http://www.concrete5.org/?cID=612245...
It keeps coming up in searches, but this link appears to be dead, just seems to go to a log in page, and logging in does nothing.