Do you have some feature in mind that you'd love to see in Couch? Let us know.
3 posts Page 1 of 1

Is it possible to add a sort of pretty url that isn't based on the mod_rewrite rules but

Code: Select all
RewriteRule ^portfolio$ "$0/" [R=301,L,QSA]
RewriteRule ^portfolio/$ portfolio.php [L,QSA]
RewriteRule ^portfolio/.*?([^\.\/]*)\.html$ portfolio.php?pname=$1 [L,QSA]
RewriteRule ^portfolio/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ portfolio.php?d=$1$2$3 [L,QSA]
RewriteRule ^portfolio/[^\.]*?([^/\.]*)/$ portfolio.php?fname=$1 [L,QSA]
RewriteRule ^portfolio/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

But to a simple something like this:

Code: Select all
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^ index.php [L]

En let couchcms handle the redirect (or include)

it has 2 advantages:

1) the htaccess is a lot simpler and more easy to rebuilt for example ngingx
2) if you add a template or page you dont have to rebuilt the htacces file and upload it anymore. Just add the page and let couch handle it.

for example here is a little basis for php handled pretty urls: ... -with-php/
Hello and welcome niwreg :)

Thank you for the link.

The method outlined there is what is commonly used by many CMS/Frameworks - the 'Front Controller' pattern where every request is routed through a single 'index.php' which in turn then invokes the indicated components.

Of course, it has the advantages you mentioned but it also leads to the paradigm you find in most CMSes - your site's HTML pages become secondary to the CMS itself and have to moved somewhere to the 'themes' folder etc.

Couch's approach is more direct (some would say primitive even) but results in you not having to reorganize your existing HTML files (except changing the extensions to .php). Every existing file directly accepts the requests meant for it with the web-server playing the router.

It does necessitate a more complex .htaccess file (and the updation required) but if you keep in mind Couch's goal which is to get retrofitted within existing sites, I am sure you'll agree that this is the most straightforward method.


Sorry for the late reply, i understand why it is build this way, however i'm working on a host with nginx, i'm luckly enough to have shell/admin access and i can change the config file to update the converted htaccess. How ever there are some people who can not change these and if so they can't use couch with pretty urls. Wich is too bad, because it's so small and simple.

a simple enough solutions would be some sort of include the page in the index.php.

So the simplicity of the html to php still excist, there is just one big wrapper around it wich includes the right page. (and maybe you should rename the orginale index.php to index2.php or something like that) and add it as an option?

i'm not shure if it is possible to build some sort of plugin for this, but maybe when i get the hang of couch i can give it a try.

Kind regards,

3 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests