Nextcloud and the PicoCMS app

Hi - Nextcloud has an app that installs a PicoCMS content management system. To work correctly, a url needs to be rewritten. Suppose you create a PicoCMS site called ‘test’. it should be available at The ‘real’ location is

I spent a lot of time mucking around with the .htaccess file trying to add a rewrite rule to get it to work. Alas without success.

To get it going I added a template to


called 25modrewrite


$OUT .= "        RewriteRule /sites/(.*)\$1 [QSA,L]" if ($VhostName eq 'sub');

where sub is the name of the vhost I have installed Nextcloud on.

Then, as root, run

expand-template /etc/httpd/conf.d/virtualhosts.conf
/bin/systemctl restart httpd.service

This adds the rewrite rule to the virtualhosts.conf file after the contents of the /etc/e-smith/templates/httpd/vhost-extra/20forcessl_redirect, which I assume is on. If not, you will need to add a line for RewriteEngine On

It is working for me at the moment with a test site. I have removed the Nethserver Nextcloud module and installed Nextcloud into a vhost manually. Wound up messing my nextcloud up by manually updating, then the nethserver updater wouldn’t work - so just installed manually. Can the update mechanism in Nextcloud be disabled?

So results may vary :slight_smile:

Or someone smart may be able to work out what would go into the .htaccess file … which would be a lot easier.


1 Like

I found this: