![]() |
codeigniter url_suffix ( .html) issue - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: codeigniter url_suffix ( .html) issue (/showthread.php?tid=76668) |
codeigniter url_suffix ( .html) issue - DarkKnight - 06-08-2020 Hello guys.. i have been using codeigniter over 7 years.recently i start using $config['url_suffix'] = '.html'; feature After that when i checked google web master tool,it detecting two different url version example:- http://www.example.com/news http://www.example.com/news.html Problem is http://www.example.com/news not redirecting to http://www.example.com/news.html automatically. so google bot mark http://www.example.com/news as duplicate page ![]() is anyway to force avoid this case?i try to check current url have .html,if not use 301 redirect to .html url version.. but even for http://www.example.com/news Code: echo current_url(); out put http://www.example.com/news.html ![]() Please help RE: codeigniter url_suffix ( .html) issue - jreklund - 06-08-2020 This are a job for your server (nginx or Apache) to fix. Haven't written such a rule, so can't give you any real tips there. May I ask why you are doing it in the first place? You also set an canonical url and Google will pick it up as an alias instead. RE: codeigniter url_suffix ( .html) issue - DarkKnight - 06-17-2020 (06-08-2020, 11:18 AM)jreklund Wrote: This are a job for your server (nginx or Apache) to fix. Haven't written such a rule, so can't give you any real tips there. i like to use .html for all urls,that give clear url structure,while some users think site create using html ![]() i solved problem using Code: $escaped_url = html_escape( remove_invisible_characters($_SERVER['REQUEST_URI'])); |