Closed liaprins closed 6 years ago
There are different approaches for routing in Kirby. Could you please share the code you are using for the routing process?
Sure thing! In my site/config/config.php file I have added:
c::set('home','blog');
c::set('routes', array(
array(
'pattern' => '(:any)',
'action' => function($uid) {
$page = page($uid);
if(!$page) $page = page('blog/' . $uid);
if(!$page) $page = site()->errorPage();
return site()->visit($page);
}
),
array(
'pattern' => 'blog/(:any)',
'action' => function($uid) {
go($uid);
}
)
));
Let me know if you need anything else!
UPDATE: I have asked my question in the Kirby Forum and got a response that fixed my issue!
Great, thank you for sharing the fix! May I close this issue?
Yes, definitely!
This is unfortunately a breaking change that will result in my needing to switch to use Disqus instead, if a solution cannot be determined. :(
I am using the approach described by Kirby here to re-route my blog's home page URL from https://[mysite.com]/blog to just https://[mysite.com] (without the "/blog") needed in the URL: Routing | Omitting the blog folder in URLs
However, when I do that, every time I try to submit a comment (now testing live, not on localhost); it gives me a 404 page. The commenting works perfectly when I am not rerouting to remove the "/blog" from my URL.
I have been reading on Kirby and I found some guidance that may help; however I am not at all a master of PHP and have not figured out how to adapt it to my situation in a way that works: Routing | Actions ...I think the issue is with the submit button and its
action
attribute, possibly...that is why I am wondering if this documentation could help to solve this issue?If you have any way to solve that, that would be amazing! I am certain many Kirby users are re-routing their URLs in this way, so a solution to this problem would be helpful to us all!
Or if I need to ask this in the Kirby forum instead, please let me know. Thanks for all your work on this plugin; I really hope to be able to use it!!!