Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
So I developed the couchcms based site in a sub directory, and now that it is complete i would like to move it to the root folder of the website. I changed the line in the config.php, and made sure that all the file references were correct, however i get this error:

'couch' folder should reside in the main web-site folder

any ideas how to fix this?
Hi,

If you have not already done so, please uncomment the following setting in config.php
//define( 'K_SITE_URL' ..
and manually put in the URL of your site there.

If the problem still persists, please try the following -
choose any template of your site accessing which throws the error you mentioned.
Let us assume it is 'blog.php'.
This template, like all Couch managed templates, will have the following line of code at the top -
<?php require_once( 'couch/cms.php' ); ?>
Add the following line before it to make it -
<?php define( 'K_TEMPLATE_NAME', 'blog.php' ); ?>
<?php require_once( 'couch/cms.php' ); ?>

As you can see, we are explicitly defining the template's name in this way.

Please try accessing the template again.
Does this make the error go away?

Please let us know.
Thanks.
<?php define( 'K_TEMPLATE_NAME', 'blog.php' ); ?>
<?php require_once( 'couch/cms.php' ); ?>


this worked, however it was gonna be a pain to add that line for a lot of pages so I modified it to be the same and get the name for every page

<?php define( 'K_TEMPLATE_NAME', basename(__FILE__) ); ?>
Thank you for letting us know.
But please be careful with basename(__FILE__) as it won't work with templates in sub-folders e.g. 'en/blog.php'.

It is only rarely that Couch fails to work out the template names (have run into this problem only 2 or 3 times so far in all these years).

It is to handle such occasions that this workaround was put in place.
I agree, it is additional work to add the names manually but unfortunately becomes essential in such rare cases.

BTW, would it be possible for you to grant me FTP access to your server for a while?
I'd like to see exactly what is throwing Couch off.

Thanks
4 posts Page 1 of 1