Papasoft

Rick Tuttle - Miami Web Application Developer

  • About
  • Wapuu Bot
  • Blog
  • Contact

How to Do a 301 Redirect on IIS Using ISAPI Rewrite

14 May 12 by Rick Tuttle

I recently launched a new WordPress site running on IIS (yes, you read correctly). The web host had ISAP Rewrite installed so we planned to use that to support Apache mod_rewrite rules.

I had used the ISAPI Rewrite filter before to handle URL rewriting like the rewrite rules that come with WordPress to support permalinks. But I had never done a 301 Redirect on IIS with this method. How hard could it be? I was replacing an ASP.NET site and needed to redirect old links like this:

OLD:  http://www.example.com/AboutUs.aspx
NEW:  http://www.example.com/about-us/

In Apache you would simply do a 301 redirect by adding the following line to .htaccess:

# This will not work using ISAPI Rewrite
Redirect 301 /AboutUs.aspx http://www.example.com/about-us/

I assumed the same syntax would work in .htaccess using ISAPI Rewrite. WRONG!

It turns out that the Redirect directive is part of Apache mod_alias and not part of mod_rewrite. So, how do you do a 301 redirect using mod_rewrite? You can do all sorts of crazy URL rewriting using mod_rewrite but I just wanted to do a simple page to page redirect!

Well, here’s how I eventually got the redirect for the About Us page and the default.aspx page to work:

RewriteRule ^default\.aspx / [R=301,L]
RewriteRule ^AboutUs\.aspx /about-us/ [R=301,L]

I hope this helps if you are trying to do a 301 redirect using ISAPI Rewrite.

Filed Under: Web Development

Firefox “sec_error_unknown_issuer” SSL Error

8 May 12 by Rick Tuttle

I noticed one of our sites was issuing an SSL Certificate error in Firefox with the error message “sec_error_unknown_issuer”. IE, Chrome and Safari were all good. (Who uses FF anymore? I stopped using Firefox when Chrome came out with developer tools.)

Anyway, it turns out that when you are issued your SSL cert you are also issued an intermediate certificate. My webhost had that box listed as optional and I didn’t have the intermediate cert filled in.

Once I entered the intermediate certificate the errors in Firefox went away. Took a few minutes to refresh.

I hope this helps anyone in the same situation.

Filed Under: Blog, Web Development

The Anatomy of a Perfect Website

7 Dec 11 by Rick Tuttle

Check out this infographic by R.O.I. Media Web Design on the anatomy of the perfect website. Interesting stuff.


The Anatomy of a perfect website

Infographic by R.O.I. Media Web Design

Filed Under: Blog, Web Development

Surviving the Programming Language Dead Pool

7 Jan 09 by Rick Tuttle

I have been writing code professionally for about 20 years now. Here is an homage to the programming languages that I used to be friends with but have lost contact (no love lost). In chronological order:

  • Atari 800 Basic
  • DEC Fortran (written on a DEC Writer, no terminal!)
  • DEC Pascal
  • DEC COBOL
  • Mac Hypercard (on a Mac Classic, circa 1988)
  • Mac Filemaker
  • MVS 360 Assembler
  • MVS COBOL
  • Borland Turbo Pascal (my introduction to OOP)
  • Borland Turbo C++
  • Microsoft C
  • Microsoft GW-Basic
  • Visual Basic 1.0 up to .NET
  • Visual C++
  • C#.NET
  • Sybase Transact-SQL (which turned into Microsoft Transact-SQL)
  • Borland Paradox
  • Powerbuilder (this is getting embarrassing)
  • Java (J2EE, JSP, Struts, blah, blah, blah)
  • ASP 3.0 and ASP.NET

I won’t mention the various third-part IT tools with their own proprietary scripting languages which I would rather forget about.

Now, here is the live list of programming languages and technologies:

  • PHP
  • MySQL (and yes, Mr. Morris…PostgreSQL)
  • HTML, XHTML, XML, all the MLs
  • CSS
  • Javascript
  • (and if you pay me enough I will do .NET and SQL Server)

Things Change Fast!

One thing I have done right is to keep abreast of changing technologies. I’m always learning. This is one reason I have had some moderate success in my career as a developer and have not gone the way of the COBOL dinosaurs.

I look back and laugh thinking about the paradigm shifts that promised to change the world: client-server, three-tier, n-tier, Java write-once run anywhere (croak), SOA, and on and on. Front-end and middle-tier technologies seem to change every three years or so. But throughout my career there is one thing that has pretty much remained the same: relational databases.

Show Me the Data

I started using SQL back around 1994 with Sybase. I can say that every month of my life since 1994 I have been writing SQL code. The actual databases have been different–Sybase, MS SQL, Oracle, DB2, MySQL–but the standard language and more importantly the logical design of relational databases have remained the same.

I learned something early on from either Martin Fowler or Joe Celko or one of those other hard-core relational dudes:

Show me the data and I will understand the application.

I have definitely found that to be true. Whenever I write an app I start with the db design and whenever I am trying to figure out somebody’s code (happens a lot), the first place I look is at the db.

How Long Will SQL Last?

I think SQL is here to stay for a long time. The APIs are changing and web scripting is starting to move away from talking directly to the DB. However, when it comes down to actually storing and retrieving the data you’re going to be using SQL, probably MySQL or PostgreSQL nowadays if you’re on the web and MS SQL, Oracle and DB2 in IT.

Are you starting in your career as a developer? My advice, learn SQL and try to stay ahead of the curve with everything else.

P.S. HTML deserves an honorable mention as the technology that has lasted and will continue to last for a while.

What programming languages are in your dead pool?

Filed Under: Web Development Tagged With: code, mysql, sql

Cake PHP 1.2 Released (Finally)

28 Dec 08 by Rick Tuttle

I’m a little late to blog about this but I’ve got a lot of excuses. So, did you hear?

Cake PHP 1.2 has been released! (Finally.)

I’ve been using the Cake PHP Framework for over 2 years now. If you are going to be doing hard-core PHP programming then I recommend it as an excellent MVC Framework.

Lately, I’ve been focusing on using WordPress for most of my development. While I had used Cake PHP for an early revision, I ended up moving to WordPress for the directory listings at Linoln Road Locator (still under development, BTW). The ease of applying a custom theme and not having to develop an admin section from scratch have sold me on using WP from now on.

Of course, I’m sure I might use Cake for more involved projects…we’ll see.

Congratulations Cake Team!

Filed Under: Web Development Tagged With: cakephp, php, WordPress

  • 1
  • 2
  • 3
  • Next Page »
© 2012 Rick Tuttle, Papasoft