Hi,
Generating URL - https://mywebsite.com/blog/blog_detail/enhancing-business-efficiency-the-ease-of-use-in-ap-automation
But desired URL - https://mywebsite.com/blog/enhancing-business-efficiency-the-ease-of-use-in-ap-automation
I want to remove blog_detail from the URL. The below line I have added in custom_routes.php
'blog/(:any)' => 'blog/blog_detail/$1'
But this is not working. I am getting 404 Error : Page Not Found Error
Can some one please help me
Best Regards,
Siri K
Problem with URL Redirection.
2 years ago
2 years ago
#1
2 years ago
#2
Hi,
Thanks for your reply .Yes, I tried.. this is also not working.. because I am getting blog title also as part of the URL like this
https://mywebsite.com/blog/blog_detail/enhancing-business-efficiency-the-ease-of-use-in-ap-automation
Thanks for your reply .Yes, I tried.. this is also not working.. because I am getting blog title also as part of the URL like this
https://mywebsite.com/blog/blog_detail/enhancing-business-efficiency-the-ease-of-use-in-ap-automation
2 years ago
#3
Hi Siri,
It's working for me. Can you share your custom_routing.php file?
I tested with a module created using the VS Code extension, called 'blog'. Then created a method with 'tgm' +tab called 'blog_detail' (using Trongate Version: 1.3.3049)then my custom_routing.php file looks like thisand the URL that works fine for me
It's working for me. Can you share your custom_routing.php file?
I tested with a module created using the VS Code extension, called 'blog'. Then created a method with 'tgm' +tab called 'blog_detail' (using Trongate Version: 1.3.3049)then my custom_routing.php file looks like thisand the URL that works fine for me
2 years ago
#4
Another question.
Is blog_detail a sub module. If so it should be
blog-detail
Dan
Is blog_detail a sub module. If so it should be
blog-detail
Dan
2 years ago
#5
Hi Dan,
No, 'blog_detail' is method (function) inside of the blog module - as seen above in my sample code
No, 'blog_detail' is method (function) inside of the blog module - as seen above in my sample code
2 years ago
#6
Hi Simon,
Thanks for your reply. This site is related to blog. I am passing the blog_id also to the url . So based on the blog_id i need to display the blog details.
But based on client requirement , we should not display blog_id in the url section. So the desired url will looks like this.
Here is the href link when user click on the blog title
blog/blog_detail function
with the above href link I am getting 404 error. If i remove id from the url for example url looks like this
https://mywebsite.com/blog/comprehensive-salesforce-solutions , I am getting empty page.
Here is the custom_routing.php
Is there any wrong in the href structure? Not getting where I am doing wrong ?
Thanks
Siri K
Thanks for your reply. This site is related to blog. I am passing the blog_id also to the url . So based on the blog_id i need to display the blog details.
But based on client requirement , we should not display blog_id in the url section. So the desired url will looks like this.
Here is the href link when user click on the blog title
blog/blog_detail function
with the above href link I am getting 404 error. If i remove id from the url for example url looks like this
https://mywebsite.com/blog/comprehensive-salesforce-solutions , I am getting empty page.
Here is the custom_routing.php
Is there any wrong in the href structure? Not getting where I am doing wrong ?
Thanks
Siri K
2 years ago
#7
Hi Siri,
Sorry for the slow response - been hectic at work and haven't had much time to myself.
You're confusing me now.. the way you are creating the anchor tag with static methods is extravagantWhy not just use a url_string? This can be created withor use something link function _make_url_string_unique() from Trongate_pages.php. Then just add an anchor in your viewThen in your blog/blog_detail function I've given you 2 ways to get the blog details page from your db or my example loremand a simple 'arc_inner' view
Sorry for the slow response - been hectic at work and haven't had much time to myself.
You're confusing me now.. the way you are creating the anchor tag with static methods is extravagantWhy not just use a url_string? This can be created withor use something link function _make_url_string_unique() from Trongate_pages.php. Then just add an anchor in your viewThen in your blog/blog_detail function I've given you 2 ways to get the blog details page from your db or my example loremand a simple 'arc_inner' view
2 years ago
#8
Hi Simon,
Thank you for your reply. The main reason why I was trying to pass blog id , they were generating blog title not in a proper way. For example
something like above, So when i fetch related blog details I'm not able to fetch details from blog_details table.
Now I have impletemented what you suggested by using url_title(). This was generated urls like below
Now my question is how can i fetch details related to these blog title ?
I was getting empty row because , there was no blog_title like this.
Thank you,
Siri K
Thank you for your reply. The main reason why I was trying to pass blog id , they were generating blog title not in a proper way. For example
something like above, So when i fetch related blog details I'm not able to fetch details from blog_details table.
Now I have impletemented what you suggested by using url_title(). This was generated urls like below
Now my question is how can i fetch details related to these blog title ?
I was getting empty row because , there was no blog_title like this.
Thank you,
Siri K
2 years ago
#9
Hi Siri,
You need to ensure the url_string is unique and probably need to set some guidelines on how the user creates a blog title. I would suggest you take a look at how DC deals with the url_string in Trongate_pages.php
You need to ensure the url_string is unique and probably need to set some guidelines on how the user creates a blog title. I would suggest you take a look at how DC deals with the url_string in Trongate_pages.php
2 years ago
#10
Hi Simon,
Sorry for my late reply. I was just recovered from fever. Thanks for your answer. Resolved my issue,
Thank you,
Siri K
Sorry for my late reply. I was just recovered from fever. Thanks for your answer. Resolved my issue,
Thank you,
Siri K