Rewrites, feeds, and smileys

So after several years of having this site hosted in a shared Windows space, I switched over to a Linux space. In the past it didn't really matter which operating system my site was hosted, but now that my site uses CodeIgniter I wanted to use friendly urls and get rid of the "index.php" that is usually in there. To do this I make a simple rewrite rule in the .htaccess file to send any 404 to the index file, which will make it work as normal.

The script can be found here: http://www.anmsaiful.net/blog/php/remove-codeigniter-index-php.html

Second thing, since my site is a blog, was to create an rss feed.  Based on the documentation I found it was just a matter of adding the xml helper and using "header("Content-Type: application/rss+xml");" to your controller to parse it as an rss feed. After that just make a view file as an xml page and make sure it validates.

You can find the article here: http://net.tutsplus.com/tutorials/php/building-an-rss-2-0-feed-with-codeigniter/

The third change I made was having text smileys convert to images in the comments section. This was the easiest since it is built into Codeigniter with the smiley helper. Just add smiley to your autoload file under helpers and you can use the functions in that file. You also need to add a folder with the smiley images into your directory so there is is a place to choose from. You may be able to add more smiley images and add them to the array at application/config/smileys.php. 

The documentation and link to download the smiley images can be found here: http://codeigniter.com/user_guide/helpers/smiley_helper.html

 

freelance writer

May31Mari - Monday, July 4, 2011 11:48:14 PM

- Thursday, September 24, 2015 02:51:07 AM

- Friday, October 30, 2015 05:17:01 AM

- Friday, October 30, 2015 05:27:07 AM



Please draw the shape in the box to submit the form: