Skip to main content

Posts

Showing posts from November, 2009

Clean URLs in PHP Yii Framework

Here is a quick tip to save some trouble. The goal here is to get clean urls like http://localhost/site/test/5 or http://localhost/site/contact without having a query string variable and also not having the filename index.php show up. My configuration: EasyPHP (apache/php/mysql combo for windows) Yii PHP framework In the Yii main.php configuration file you need: 'urlManager'=&gt;array( 'urlFormat'=&gt;'path', 'showScriptName'=&gt;false,), Inside the ‘components’ array area. In the primary directory where the index.php file is you need a .htaccess files with this in it: Options +FollowSymLinks IndexIgnore */* RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [L] If you have problems, check your httpd.conf file for these items: <directory c:\easyphp\www> Inside that directory section, make sure the rules don’t disallow the removal of index.php or the other rewrite rule...

Setting Up Netbeans and Ruby

I’ve been considering some development with Ruby and Rails. As I’ve used the Netbeans IDE before and liked it, I downloaded the Ruby version to give it a try. The main benefit here is that you can do a lot of things without the console. I can add models, scaffolds, migrate databases, and such with a few clicks. The current default install doesn’t have the most current version of “JRuby” (that being ruby created with 100% Java) installed, so I opted to figure out how to update Netbeans with the most current interpreter. Here is a quick list of things to do: download the Ruby Netbeans IDE Download latest version of JRuby Install the new version to: C:\Program Files\NetBeans 6.7.1\ruby2\ Depending on your install directory of Netbeans. A directory will be created: jruby-1.4.0 Depending on the currently available version of JRuby. In Netbeans, go to the platform manager in the menu “tools >> Ruby Platforms”: Select auto-detect platforms, or add ...