Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi,

I have an existing site with its own version of "Pretty URLs" already in place. In the root there is an index.php page and it fetches the correct page from a '/views' directory. A .htaccess is in place to do this:

RewriteEngine On
RewriteBase "/"

RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
RewriteRule ^(wp-content|wp-includes|wp-json|admin)($|/) - [L]

RewriteCond "%{REQUEST_URI}" "!=/index.php"
RewriteRule "^(.*)" "/index.php?url=$1&pname=views/$1" [L,PT]

The problem is, all my editable regions appear in the admin panel under index.php and most instantly come up as "Field not found!".

How can I fix this? Can I put some PHP in the header of each view file to specify its path and template name to Couch CMS?

Thank you,
Reece
Hi,

It appears that you are trying to integrate Couch with an existing PHP application.

Couch, however, is meant to be retrofitted in only static (i.e. plain HTML/CSS/JS) sites;
trying to make it co-exist with another PHP codebase will likely only cause the two to step upon each other's toes and break the site in unforeseen ways (the issue you are running into is one).

So, I am afraid, I don't see any safe workaround for this problem.
KK wrote: Hi,

It appears that you are trying to integrate Couch with an existing PHP application.

Couch, however, is meant to be retrofitted in only static (i.e. plain HTML/CSS/JS) sites;
trying to make it co-exist with another PHP codebase will likely only cause the two to step upon each other's toes and break the site in unforeseen ways (the issue you are running into is one).

So, I am afraid, I don't see any safe workaround for this problem.


The PHP is really just for the pretty URLs. I want to specify an exact url to go to an exact path, are you able to do this with CouchCMS? eg. How would I point https://example.com/test to /views/test/index.php?
Couch depends very heavily on the URLs to figure out which template is being invoked and in which view (page_view, list_view etc.). So using a custom format is going to confuse it.

That said, if you could explain to us a bit more the way your site is structured, perhaps we can figure out a way to restructure it using Couch alone?
4 posts Page 1 of 1
cron