Welcome Guest, Not a member yet? Register   Sign In
How to use routing to add .html suffix?
#1

(This post was last modified: 11-04-2019, 10:42 PM by tuandungb.)

Hi everybody.
I tried to use routing to add .html suffix .In router.php :

Code:
$routes->get('abc.html', 'Homepage::show_categories_page/abc');

I hope when I go to URL : mydomain.com/abc.html ,it would swich to above routes.But it redirect to / (index.php)

When I tried to remove .html suffix.It works perfectly 
Code:
$routes->get('abc', 'Homepage::show_categories_page/abc');

I noticed at CI 3,it can be add suffix though application/config/config.php :
Code:
$config['url_suffix'] = '.html';


But I found nothing similar as that file in CI 4.My question is how to use routing to add .html suffix?

Thank you all for your help.
Reply
#2

Do you have any susggest?
Reply
#3

Did you find any solution for this?
Reply
#4

Haven't tried this, but I guess it's do to the fact it's interpreted as regex. So try escaping the wildcard dot.
Code:
$routes->get('abc\.html', 'Homepage::show_categories_page/abc');
Reply




Theme © iAndrew 2016 - Forum software by © MyBB