install into a directory?

Permalink
currently my c5 is installed at this location

http://www.all-final.com/concretetest/...

will it be possible if I want to access c5 without the /concretetest/ in the URL? There are already some other stuff at the root so I really think keeping c5 in a folder will help the root not be too messed up.

 
hanicker replied on at Permalink Reply
hanicker
try adding an
.htaccess
on your root with this content:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/DIR/
RewriteRule (.*) DIR/$1 [L]

where DIR is the name of the directory where you have c5.
You also have to change your config/site.php
Panupat replied on at Permalink Reply
Should that go before or after the pretty URL script?

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /concretetest/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>


For site.php, should I delete this line or change it to something else?
define('DIR_REL', '/concretetest');
Shotster replied on at Permalink Reply
Shotster
While I haven't tried in quite a while, I was unable to get things to work properly with pretty URLs enabled if the C5 installation was anywhere but the root.

I'd be curious to know if anyone has managed to do so.

-Steve
Panupat replied on at Permalink Reply
hmmm I seem to have some issue as well. So far I am now able to remove the /concretetest from my URL using the following codes below
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^forum/ - [S=3]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ concretetest/index.php/$1 [L]
</IfModule>


However all the links will still link to /concretetest/page-name

Removing this line from site.php , and the links are corrected. However, all the images are gone : / the images still need the /concretetest/file in the URL.

define('DIR_REL', '/concretetest');
Ricalsin replied on at Permalink Reply
Ricalsin
Don't delete the line, simply make it null:
define('DIR_REL','');


You might later decide to put your c5 in a sub folder again and you would need this. C5 incorporates the DIR_REL value throughout, so keep the logic together.
Panupat replied on at Permalink Reply
When I make it null, the images no longer shows up. Looks like path to the /file still need that value intact.

But if I leave it the way it is, all the links generated by /auto-nav will still have the directory name in it.

Might be able to fix this with auto-nav templates. I'm trying it out.
Ricalsin replied on at Permalink Reply
Ricalsin
Don't delete the line, simply make it null:
define('DIR_REL','');


You might later decide to put your c5 in a sub folder again and you would need this. C5 incorporates the DIR_REL value throughout, so keep the logic together.
Ricalsin replied on at Permalink Reply
Ricalsin
Don't delete the line, simply make it null:
define('DIR_REL','');


You might later decide to put your c5 in a sub folder again and you would need this. C5 incorporates the DIR_REL value throughout, so keep the logic together.
Panupat replied on at Permalink Reply
OK. I got it working for now. I don't know if there will be any problem showing up later, but here's what I do.

Turned on pretty URL.

Used this .htaccess file. It's excluding my forum from the rule. My concrete directory is /concretetest

RewriteEngine On
RewriteBase /
RewriteRule ^forum/ - [S=3]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ concretetest/index.php/$1 [L]


Leave the site.php the way it is. This line stays the same
define('DIR_REL', '/concretetest');


Next, copy over the default controller.php
- from /concrete/blocks/auto-nav
- To /blocks/auto-nav

With the new file you copied over - find this function and remove all the DIR_REL

function getURL() {
         $dispatcher = '';
         if (!URL_REWRITING) {
            $dispatcher = '/' . DISPATCHER_FILENAME;
         }
         if ($this->cPointerExternalLink != '') {
            $link = $this->cPointerExternalLink;
         } else if ($this->cPath) {
            $link = DIR_REL . $dispatcher . $this->cPath . '/';
         } else if ($this->cID == HOME_CID) {
            $link = DIR_REL . '/';
         } else {
            $link = DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $this->cID;
         }
         return $link;


Might need to clear cache after you upload this file.
Panupat replied on at Permalink Reply
erm ok. found a problem. When I log in, the site only recognized my cookie if I access them with /concretetest in the URL.

I can't find where to modify this. Anyone can help me point out?