web development

a drupal path redirect bookmarklet

i threw together a fancy little javascript bookmarklet to create redirects in drupal, and figured i'd share:

<a href="javascript:d='example.com/';location.href='http://'+d+'admin/build/path_redirect/new?edit[redirect][redirect]='+encodeURIComponent(location.href.split(/[\?#]/)[0].replace(RegExp('https?://'+d,'ig'),''))+'&edit[redirect][query]='+encodeURIComponent(location.href.indexOf('?')&gt;-1?location.href.split(/[\?#]/)[1]:'')+'&edit[redirect][fragment]='+encodeURIComponent(location.href.indexOf('#')&gt;-1?location.href.split(/#/)[1]:'')+'&edit[path]='+encodeURIComponent(String(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text)).replace(/[^a-zA-Z0-9]+/g,'-').toLowerCase());">new path redirect</a>

for this to work you need the path redirect and prepopulate modules installed... then simply replace "example.com" in the snippet above with your domain name, and save the link as a browser bookmark.

now click on it, and it will add a redirect to the current page. if you select any text before clicking the bookmarklet, it will use that text for the redirect path. this bookmarklet supports both internal (drupal) and external paths. it also works with urls containing queries (?foo=bar) and fragments (#baz). tested in ie, firefox and safari.

have fun!

justin hileman dot info is featuriffic!

justin hileman dot info has been updated. please allow me to draw your attention to the links at the bottom of the main page. i'm pretty excited about a couple. specifically the two with little arrows next to them.

you should click on them.

my space is cooler than your space

if you've visited my myspace profile recently, you've noticed that it doesn't look much like a standard myspace profile. which i'm pretty stoked about, since the hideousness of most myspace profiles approaches obscenity.

one key element in the makeover of my space is the blog. you see, i have way too many blogs already, so i really don't want to post to all of them. and i usually just end up crossposting everything from my regular blog to the myspace blog.

so i replaced it.

drupal dynamically generated MySpace blog replacement

a more secure drupal [multisite] install

I love the Drupal CMS. One of my favorite features of Drupal is the ability to do a multisite install. This site and my other blog, i <3 stella, are hosted on the same box, using the same Drupal install. Several sites can share one codebase. Updates are easily rolled out to every site simultaneously. Overall, it's a wonderful idea. But I have some problems with the implementation...

drupal secure multisite tutorial after the jump.