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

So my url is like domain.com/showcase.html, without changing the structure can I make the url to display like domain.com/library/showcase.html? I found something on htaccess but could not make it work, can you suggest something?

I might do this with adding the showcase within a template but it will require a lot of records to re-created, so trying to find a easier way:)

Thank you!
"domain.com/showcase.html" means pretty urls are on, index.php template and cloned page named showcase.
If the above is 100% correct, then define in your index.php template a folder like this:
Code: Select all
<cms:folder name='library' title='Library' />

Then revisit template as superadmin and folder will appear in admin panel. Visit your cloned page and a dropdown will appear to put that page into a folder. Save.

Next step is to regenerate htaccess rules with gen_htaccess.php (I assume you know the drill, since you have pretty urls enabled already!)

Next, don't forget to establish some rule to redirect from old url to new url. Following should be enough:
Code: Select all
RewriteRule ^/showcase.html$ /library/showcase.html [QSD,L,R=301]
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
trendoman wrote: "domain.com/showcase.html" means pretty urls are on, index.php template and cloned page named showcase.
If the above is 100% correct, then define in your index.php template a folder like this:
Code: Select all
<cms:folder name='library' title='Library' />

Then revisit template as superadmin and folder will appear in admin panel. Visit your cloned page and a dropdown will appear to put that page into a folder. Save.

Next step is to regenerate htaccess rules with gen_htaccess.php (I assume you know the drill, since you have pretty urls enabled already!)

Next, don't forget to establish some rule to redirect from old url to new url. Following should be enough:
Code: Select all
RewriteRule ^/showcase.html$ /library/showcase.html [QSD,L,R=301]


Thank you for your answer.
I tried adding this code
Code: Select all
<cms:folder name='library' title='Library' />


to index.php and showcase.php but did not see any change. My index.php is not clonable nor nested page
I had this in my .htaccess (the one I generated with gen_htaccess.php)

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


when I add your line I get an 500 Internal Server Error.
It seems that your website structure is not what I have thought, because showcase.php appeared out of nowhere :D
Please come to skype and explain urls in detail. I will try to recreate it here and see how to make a working redirection.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
4 posts Page 1 of 1