How to use routing to add .html suffix? |
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.
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'); |
Welcome Guest, Not a member yet? Register Sign In |