• Do you archive old work, images, code etc. on another disk other than your main one? Still have 300GB free space on my iMac w/500Gb disk
    You should follow me on twitter here

Category: xhtml

Redirect directory to index page

July 1st, 2008

I was recently asked by a client to redirect all pages in a directory to the directory index page. They were ending a co-branding service with another company. What they wanted was to keep only a re-worked index page in the directory as being visible, but not show people who may have bookmarked other pages in this directory the 404 page.

I searched and searched Google for this and couldn’t find exactly how to do this via .htaccess anywhere. I found similar information, such as how to redirect from directory to directory, but not how to redirect all pages to just one page in the same directory. After some trial and many errors, I figured it out.

So here I post my .htaccess for posterity, and my own need. Hope this helps others as well.

RewriteEngine On
# don't redirect .css, .jpeg, .jpg, .png or .gif extensions
# the extensions are separated by a pipe ("|")
RewriteRule \.(css|jpe?g|png|gif)$ - [L]
# if the request isn't for index.php then
# redirect to index.php
RewriteRule !^index\.php$ /index.php [R=301,L]

**NOTE: if this is a temporary redirect, you can substitute this for the last line:

RewriteRule !^index\.php$ /index.php [L]

The line RewriteRule \.(css|jpe?g|png|gif)$ - [L] is used so that image and css calls are not redirected.

So basically this will take any page called for in http://www.example.com/something/ and redirect it to http://www.example.com/something/index.php as long as the .htaccess file is in the /something directory.

Free Design Reverb Wordpress Theme!

May 1st, 2008

I’m releasing the previous Design Reverb theme free for your use!

D-R 1.0 is a clean and simple 2 column theme, works with Wordpress 2.0+ and has areas for Google Adsense and/or Amazon affiliate ads.

Download dr_1.zip

This theme is not widgetized. If you want to widgetize it, just read up at the Wordpress site, though you may have to edit the css.

D-R 1.0 uses the following plugins to work correctly:

Gravatar – for the comment avatars.

Related Posts – for the related post section of each post.

I won’t be giving any support for it though, it is released as is.

I do ask that you leave the “Created By Design Reverb” in the footer.

Other than that, use it as you will and enjoy!

April 28th, 2008

Designers Toolbox
Design tools for creative professionals. Print resources, online guides, legal forms, and much more.