codeigniter url_suffix ( .html) issue |
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
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.
(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'])); |
Welcome Guest, Not a member yet? Register Sign In |