htmly
htmly copied to clipboard
Custom permalink
How can I change www.example.com/post/title
to www.example.com/books/title
or remove /post
completely? I could change it in WordPress but HTMLy doesn't seem to have such option?
Current htmly only support www.example.com/post/title
and www.example.com/year/month/title
but perhaps it will support more custom URLs later.
www.example.com/%postname%
and www.example.com/%category%/%postname%
options would be great. I can't port my websites to HTMLy without these. I tried editing HTMLy core files and managed to change /post
but when loading post it gives me error 404 page not found.
After studying PHP for 5 days I finally managed to change /post
into %category%
. For someone who is good with PHP I imagine such feature would be pretty easy to implement into the core.
@elpsykongroo did you use example:
get('/:category/:name', function ($category, $name)
@danpros Yes, edited a couple lines in htmly.php, functions.php, admin.php and edit.content.html.php
. Tested and everything seems to work great.
Also I don't want /category
slug to appear in category url so I removed it from get('/category/:category', function ($category)
, but then sitemap doesn't work because of it. Any idea how to make it work?
This is custom modification so I don't support it, the best solutions is you make pull request with your current modification but you should adding more value instead of just changing existing core. Let say creating an options to switch to another slug type etc.
Example new valuable addition:
www.example.com/%category%/%postname%
Edit: You can contact me directly if you want to discuss it further.
I tried to do the same (example.com/%category%/%postname%), unfortunately i get error 500. Could you please give a detailed instruction which lines of files need to be replaced, and the text to replace. thank you in advance.
This is a very useful option, sorry, it would be fine if it went into the kernel in the future.
@achadidi im looking for solution to remove dates from post slug. Can You help me with? Or give hint?
I was wanting to do the same thing as the original poster. Hopefully this gets added in the near future. It would be good for SEO. I'm going to dig around in the code and see if I can get it working myself. I'll share my efforts if I succeed.
Hello, Can someone (@achadidi ?) explain what to edit to remove /post/ from url ? I manage to make it work only to make it also impossible to login/logout again. Any help would be greatly appreciated. thank you
+1
I'm newbie with HTMLy, btw great blogtool :) I want to change the url ../post/my_post/ to ../bericht/my_post/ Found the code in system/admin.php, but when change manually, after update it override the code. Some news when the option custom permalinks added?
This issue is too old, I will close this one. Please create new issue for possible improvements. Thanks