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

was wondering if it's possible to remove .html from url's while using PrettyURL for an even "prettier" url?

I've done this in the past (not using CouchCMS) with .htaccess but since this seems a little more delicate I thought I'd ask before embarking on it and perhaps breaking my config.

thanks a ton!
-Izzy

p.s. Kamran and Cheesy, thanks for rocking the Couch!
Hi and welcome to our forums, izzy :)

Couch. as it stands right now, uses the '.html' extension to differentiate between a 'folder' and a 'page'.
For example, in the following URL 'somename' would be considered a folder -
http://www.somesite.com/somename/
while in the following URL it'd be a page
http://www.somesite.com/somename.html

As you can see, the html extension affects the inner working of Couch so it won't be possible to change that.

'Nested pages', however, don't need folders so they don't have the .html extension.
If the number of pages your site has is not likely to run into thousands, you may use 'nested pages' instead of the normal cloned pages to have the 'prettier' URL you mentioned :)
Is there any chance that page & folder pretty URLs behaviour could mimic nested paged in future releases?

Also, my site is likely going to grow to several thousand pages, is there a downside to using nested pages for this?


Sam
Is there any chance that page & folder pretty URLs behaviour could mimic nested paged in future releases?
As I said in the prev post, the differentiation between 'page' and 'folder' is the '.html' prefix. So, I don't think we'll change that in the near future.

Also, my site is likely going to grow to several thousand pages, is there a downside to using nested pages for this?
Yes. Nested-pages are primarily built for 'stand-alone' pages of a site (usually those that have a distinct entry in the menu e.g. about-us, contact, etc.) as opposed to pages within 'sections' (e.g. blog, news, portfolio etc.).

It is highly unlikely that the 'several thousand' pages you mentioned are stand-alone pages.
For such pages please use the normal cloned pages as they can scale to huge number of pages.
Nested-pages will take a performance hit if you have more than a couple of thousands.

Hope this answers your query.
Is this now possible using the routes feature?

Not allowing this is a showstopper if we are to migrate an existing site as we can't match our existing URL structure and would need to implement a large number of redirects.

I tried using routes, but couldn't show the editable areas for the page with K_IGNORE_CONTEXT set.
@ChrisInCambo, theoretically, yes, using custom routes we should be able to mimic completely the way things work by default in Couch but use a different URL structure.

Practically, however, this will require some extra work (at least preliminarily) to map the default views.
This, perhaps, will not be easy for the uninitiated.
I think I'll have to create a detailed working tutorial providing the bootstrapping part that can then be easily extended. Hopefully, I'll be able to do that soon enough.

For now, I'd suggest you please use the custom routes only for custom views (as shown in the tutorial).
For the default views, please use the default URLs (i.e. the ones with the .html appended).

Thanks.
6 posts Page 1 of 1