Create .html pages - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Create .html pages (/showthread.php?tid=60256) |
Create .html pages - El Forum - 02-15-2014 [eluser]Unknown[/eluser] Hi there, I've been looking on the internet for help with this. Too bad i couldnt find anything helpfull. I've got a page controller and i'm using the template builder. Now with my page controller Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); And my routes.php Code: $route['page/(:any)'] = 'page/$1'; What i want now, is that i can visit localhost://[websitename]/about-me.html and that would the load the about-me.php template. Because now its like localhost/[websitename]/page/about-me Could someone help me with this problem? Create .html pages - El Forum - 02-15-2014 [eluser]CroNiX[/eluser] There's no real benefit to having an .html extension nowadays, but you can try setting the url_suffix setting in application/config/config.php Create .html pages - El Forum - 02-15-2014 [eluser]CroNiX[/eluser] Also, if you don't want 'page' in the url, your route would be: Code: $route['(:any)'] = 'page/index/$1'; Code: $route['default_controller'] = 'page'; //loads page/index for http://yoursite.com/ Create .html pages - El Forum - 02-16-2014 [eluser]Tpojka[/eluser] [quote author="CroNiX" date="1392506123"]There's no real benefit to having an .html extension nowadays, but you can try setting the url_suffix setting in application/config/config.php[/quote] recently, I had one situation that I needed to add that. In matter of fact On page was flash animated navigation header that client wanted to keep. Since I didn't have *.fla source but only *.swf with integrated links with html endings, converting site to CI, I made it with *.html suffix. In other cases, I agree there is no point these days to keep it up. Create .html pages - El Forum - 02-16-2014 [eluser]Unknown[/eluser] [quote author="CroNiX" date="1392506869"]Also, if you don't want 'page' in the url, your route would be: Code: $route['(:any)'] = 'page/index/$1'; Code: $route['default_controller'] = 'page'; //loads page/index for http://yoursite.com/ Cheers, this worked for me. I know it's not needed to use .html, but the person that i'm making his website for doesnt understand that and just want it in his website Create .html pages - El Forum - 02-18-2014 [eluser]Unknown[/eluser] If .html will be of no use the how can we identify that it is an html file..?? <a href="http://webeminence.com/squarespace-review/">squarespace website builder</a> |