Welcome Guest, Not a member yet? Register   Sign In
Setting url suffix
#8

This is a kludge of course (Codeigniter 4 should support this natively in my opinion) but you can do something like this.  The regular expression addition strips off any .html extension before continuing on processing the route.  This allows requests to work with or without ".html" as the file extension present in the original request. 

./system/Router/Router.php

Line 173:

        // Decode URL-encoded string
        $uri = urldecode($uri);
       
        // kludge to work around .html extension on existing links
        $uri = preg_replace('/(.*)\.html(\?.*)?$/','\1\2',$uri);
Reply


Messages In This Thread
Setting url suffix - by groovebird - 07-04-2022, 07:49 AM
RE: Setting url suffix - by kenjis - 07-04-2022, 02:28 PM
RE: Setting url suffix - by kenjis - 07-04-2022, 05:41 PM
RE: Setting url suffix - by groovebird - 07-20-2022, 09:38 AM
RE: Setting url suffix - by kenjis - 07-20-2022, 02:40 PM
RE: Setting url suffix - by groovebird - 07-20-2022, 02:50 PM
RE: Setting url suffix - by kenjis - 07-20-2022, 04:17 PM
RE: Setting url suffix - by codegrunt - 09-13-2022, 10:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB