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

I have this website: my-url.be/cocktails/some-page.html
(pretty url's enabled)

The "cocktails" part of the url is the name of the clonable template file cocktails.php (with a lot of generated pages.

Now my client want to change his url to "my-url.be/make-cocktails/some-page.html

How can I do this change the best way?
If I change the template file name, I will lose all generated messages right?
Hi Sam,

If you simply rename the template from 'cocktails.php' to 'make-cocktails.php', Couch will think you deleted 'cocktails.php' and added a new (with no pages) template named 'make-cocktails.php'. So, yes it will result in data loss.

To safely rename a template without losing its existing cloned-pages, we need two steps -

a. Access your database (using phpMyAdmin or any other DB manager that you have) and browse the 'couch_templates' table.
Each of the template that your site consists of will have a record for itself in this table.
We'll be interested only in the 'name' column. Find the record displaying 'cocktails.php' in the 'name' column. Change the value of the name from 'cocktails.php' to 'make-cocktails.php'.

b. Now rename 'cocktails.php' file to 'make-cocktails.php'.

The admin-panel should now show all the original pages under 'make-cocktails.php'.

Hope this helps.

P.S. Please don't forget to backup your database before carrying out this procedure.
Thanks!

For the completeness: I also updated the .htaccess file :)
3 posts Page 1 of 1