Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
My first Couch site has recently gone live - a straightforward site in which I did use clonable templates - but only to display the 'list' e.g. on an events listing page - a full detail page for each event is not required.

The Couch documentation makes it perfectly clear that pretty urls only apply to clonable templates - so the Couch method of generating the .htaccess commands (with gen_htaccess.php) doesn't apply to my site.

I would like to prettify the URLs by dropping the .php extension so that http://www.site.com/contact.php becomes http://www.site.com/contact. Would doing this cause any problems for now and if I were to implement cloned pages in the future?

Another quick general question re pretty urls - if a url is prettified ... is it then known to the whole world by that new name? i.e. including sitemaps, internal links and so on?
The .htaccess file generated by gen_htaccess.php will work on non-cloned templates also (i.e. it will turn '/contact.php' to '/contact/'.
You can safely go ahead and implement prettyURls the regular way. Just do not forget to regenerate the .htaccess when you add new templates (cloned or otherwise) latter on.

Replying to the other question - once prettyURLs are turned on, the prettified URLs become the canonical URLs of the templates (and cloned pages).
If someone accesses a page using the old URL, Couch makes sure to redirect him to the new URL (with a 301 Page moved permanently HTTP code).
TIP: always use cms:link tag to output links of your templates/pages. It outputs links taking into consideration whether or not prettyURLs are turned on.
I have generated the .htaccess file and am pleased to say that the .php extension is no longer showing up - much prettier! But I have a couple of other problems now:

1. 404 error page - which I posted about separately - it has to be a .html file due to 1and1.co.uk requirements.

So I placed:

ErrorDocument 404 http://www.lawrencepowerviola.com/404.html

into the newly generated .htaccess file. BUT instead of seeing my 404.html I get a blank screen if page isn't found.

2. Redirection from .html to .php The website has been live for a few months with a holding page of index.html and my previous .htaccess file on the Couch site (before generating it using gen_htaccess.php) contained the following line to redirect from index.html to index.php:

redirect 301 /index.html http://www.lawrencepowerviola.com/index.php

Putting this line into the gen_htaccess version of .htaccess gives a browser error:

The page isn't redirecting properly / Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

I tried deleting 'index.php' and got the same problem. If you try to access the url for index.html - you see a blank screen.

Any suggestions? And thanks!
Potato, this should work:
Code: Select all
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ http://www.website.com/ [R=301,L]
If you have another page that you want to redirect also, add code like this:
Code: Select all
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /contact\.html\ HTTP/
RewriteRule ^contact\.html$ http://www.website.com/contact/ [R=301,L]

Code: Select all
ErrorDocument 404 /404.html

** Place Above Code Between These Lines **

#If your site begins with 'www', uncomment the following two lines
@potato

Couch returning a blank page (although with the proper 404 HTTP code) on 'Page not found' condition on certain server configurations is actually a known little bug.
It has been fixed in v1.2.5RC1 available for download from the forums. For 1.2.0, this patch will fix it
patch.zip
(129.2 KiB) Downloaded 626 times

I have already applied the patch to your site so you do not need to do it again.
The 404 page now seems to be working OK.

As for the redirection from index.html to index.php, I simply made the following change to the .htaccess file
Before:
Code: Select all
#DO NOT EDIT BELOW THIS
RewriteRule ^index.php$ "" [R=301,L,QSA]

After:
Code: Select all
#DO NOT EDIT BELOW THIS
RewriteRule ^index.html$ "" [R=301,L,QSA]
RewriteRule ^index.php$ "" [R=301,L,QSA]

It seems to be working well too.

Could you please check and confirm that the changes are ok?
Thanks
Many thanks for your help with this KK (& Cheesypoof too) - I have tested it and things are behaving perfectly (including showing my 404 page if the url of a template is requested).

Just to clarify over the "patch" - when I download (imminently) Couch for my next client site from the usual "download & licence" link - will it contain this patch?

I can only reiterate how delighted I am to have discovered Couch - having now been through the whole cycle of designing, building and Couch'ing a site for a client - I have full confidence to press on with Couch and try out more things!

:D
when I download (imminently) Couch for my next client site from the usual "download & licence" link - will it contain this patch?

I'd advice you download and use v1.2.5RC1 (viewtopic.php?f=5&t=6346)
It contains the patch and is very soon going to be the release version available from our download page.

And thank you very much indeed for appreciating Couch :)
7 posts Page 1 of 1
cron