Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Pretty urls are enabled in config.php - define( 'K_PRETTY_URLS', 1 );
Link gets generated correctly - domain.com/blog/article-title.html and domain.com/blog
Links to separate blog posts are set with <cms:show k_page_link />

Whenever I access domain.com/blog/article-title.html or domain.com/blog I receive "404 page not found". The moment I set pretty URLs to 0 everything starts to work but (obviously) every article link will resolve like so domain.com/blog.php?p=22. In the blog tutorial https://docs.couchcms.com/tutorials/portfolio-site/blog-2.html, there are very few instructions on (the Finishing touches bit) how to set the pretty URLs.

While following these instructions - https://docs.couchcms.com/concepts/pretty-urls.html - and going to domain.com/couch I get "404 page not found" as well.

Would anyone mind elaborating a bit more on how to set pretty URLs correctly?
I have renamed the initial "couch" directory that's why I was getting 404 on domain.com/couch/gen_htaccess.php. Going to correct directory, copying the contents of the generated file and creating the .htaccess in the root directory seems to solve the problem.

Now my articles are generated with .html ending - domain.com/blog/article-title.html. What should I change or add in the .htaccess file to remove the .html ending to get the following URL - domain.com/blog/article-title?

I think it will be very useful to reference this page - https://docs.couchcms.com/concepts/pretty-urls.html - in the tutorial for creating a blog and portfolio websites. Is there a way to contribute to the documentation?
What should I change or add in the .htaccess file to remove the .html ending to get the following URL - domain.com/blog/article-title?
Without the '.html', there would be no way of figuring out whether 'article-title' is a page or a folder within 'blog'. Therefore, there is no provision for removing that extension.

Is there a way to contribute to the documentation?
Sure. Please feel free to contribute at https://github.com/CouchCMS/Documentation

Thanks.
Thanks for your help KK! Please consider the issue being resolved
Hi,

I'm writing here not to create a separate topic.

My website has prettyUrls enabled, so every subpage describing a separate "Product" of my company has an URL going like: https://domain.com/solutions/productname.html

I wanted to create several subdomains, redirecting the browser to these product pages, eg.:
product1.domain.com: https://domain.com/solutions/product1.html
product2.domain.com: https://domain.com/solutions/product2.html

etc.

The problem is, my hosting solution automatically adds a slash at the ending of redirected URL (https://domain.com/solutions/product1.html/) - resulting in a 404 error.

Is there any way - like .htaccess condition or anything - to automatically remove that slash and make the subdomains redirect correctly to the subpages?

Thanks in advance!
Hi,

The problem is, my hosting solution automatically adds a slash at the ending of redirected URL

Perhaps you could ask them to turn this behaviour off? Or ask them if they are using a .htaccess file to effect their rules?
6 posts Page 1 of 1
cron