Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
I have created a clonable template so the client can create new pages themselves and I have done just done Nested Pages (AKA Menu Maker) so they can create the menu links themselves and also pretty url's and it's working all ok when tested the links, the only issue I am facing is I have called the clonable template page new-page.php and the link has been altered to new-page/test-new-page.html which am guessing has been done by the pretty urls/htaccess file and adding the template name in the url I was hoping to have it as test-new-page.

The odd thing is the other pages are fine and display as the http://www.domain.co.uk/home-care/ for example but guessing as that is because it's not a clonable template but it's just this new-page.php clonable template page that is being displayed as http://www.domain.co.uk/new-page/test-new-page.html

How can I achieve that please so it's like the other urls and displays as http://www.domain.co.uk/test-new-page as unsure how to?

The htaccess file code is below

Code: Select all
Options +SymLinksIfOwnerMatch -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On

#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it RewriteBase /subdomain1/subdomain2
RewriteBase /

#If you wish to use a custom 404 page, place a file named 404.php in your website's root and uncomment the line below.
#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it ErrorDocument 404 /subdomain1/subdomain2/404.php
#ErrorDocument 404 /404.php

#If your site begins with 'www', uncomment the following two lines
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


#DO NOT EDIT BELOW THIS

RewriteRule ^index.php$ "" [R=301,L,QSA]

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]

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

#home-care.php
RewriteRule ^home-care$ "$0/" [R=301,L,QSA]
RewriteRule ^home-care/$ home-care.php [L,QSA]
RewriteRule ^home-care/.*?([^\.\/]*)\.html$ home-care.php?pname=$1 [L,QSA]
RewriteRule ^home-care/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ home-care.php?d=$1$2$3 [L,QSA]
RewriteRule ^home-care/[^\.]*?([^/\.]*)/$ home-care.php?fname=$1 [L,QSA]
RewriteRule ^home-care/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
</IfModule>


UPDATE: I just added nested_pages='1' to the new-page.php file and the url now looks like http://www.domain.co.uk/new-page/test-new-page/ but would like to have it displayed as http://www.domain.co.uk/test-new-page/ so if possible to remove the template name from the url

Can anyone help on how I can achieve the url to display like that for clonable nested pages template please
Hi,

Template name will necessarily appear in the URL with the exception of those ending with 'index.php'.
So, if you do not want the template name showing up in the URL, use a template named 'index.php'.

Hope this helps.
Thank you KK, I remember now as think I asked that question before when first started using couchcms, I should of remembered that to be honest, sorry. I have renamed the template to pages as sounds better in the url
3 posts Page 1 of 1
cron