Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hi, hopefully someone can help this if they can understand what my problem is.

I have used Couch quite a bit and used it for it's list view and page view pages, such as on the tutorial you have /portfolio/ as the list view, and /portfolio/post-1/ - /portfolio/post-2/ for example as the page views.

Is it possibly with Couch to only have the page views but also have them sit in a folder?

For example, I wish to be able to create multiple pages which will sit like -

Code: Select all
.com/services/service-1/ 
.com/services/service-2/
.com/services/service-3/

I want these service pages (service-1, service-2, service-2) to be accessible, but not have the /services/ page accessible to the public (redirect to index page or something), is this possible? I understand if this may be questioned as to why this will want to be done but I my reasons. :P

I am not sure if list/page view is the correct way to go about this, maybe someone could enlighten me on this situation.

Thanks.
I think I understood the problem :)

But first, a little correction - you said
/portfolio/post-1/ - /portfolio/post-2/ for example as the page views

It should actually be /portfolio/post-1.html, /portfolio/post-2.html (pages have the '.html' affixed).

So, you want visitors to access
http://www.yoursite.com/portfolio/post-1.html
http://www.yoursite.com/portfolio/post-2.html
but on accessing the following URL, you'd want them to be redirected to the index page
http://www.yoursite.com/portfolio/

As you yourself mentioned, the URL in question is a 'list-view'.
We can easily put a conditional in the template to check if the visitor is accessing this list-view and if so redirect him to the desired location.
Placing the following code in the template will do just that -
Code: Select all
<cms:if k_is_list>
    <cms:redirect url="<cms:link masterpage='index.php' />" />
</cms:if>

Hope this helps.
That works great KK, thank you!

Do you happen to know what I would add for Google Bot/Other search engine crawlers to not cache /portfolio/ but for them to cache /portfolio/post-1/ /portfolio/post-2/ etc.

Would it just be as simple as adding the code below within <head></head> of the services_list.php page within snippets? -

Code: Select all
<meta name="ROBOTS" content="noindex, nofollow">
    <meta name="googlebot" content="noindex, nofollow">


Thanks.
I think the best solution would be to use 'permanently' with cms:redirect tag
Code: Select all
<cms:redirect url="<cms:link masterpage='index.php' />" permanently='1' />

This will cause Couch to send back a 'HTTP 301 Permanently moved' response to browsers (and google) thus causing them to ignore /portfolio/ altogether (i.e. no caching, no indexing).
If I was to use that bit of code and have it ignore /portfolio/ completely, would it also ignore something within /portfolio/? Such as it ignores /portfolio/ but indexs/caches /portfolio/post-1/?

Thank you.
Only the exact URL that responds with 301 will be affected.
So, don't worry the sub-pages will be fine.
6 posts Page 1 of 1
cron