kdmurray.blog

The crossroads of life and tech

Redirecting Your Website (URL Redirection)

It’s late, and I’m tired, so this is gonna be a short post.  I got a question from @Mattoid12 on twitter tonight about how to redirect a website.  I’m going to show three ways, and then provide a link to a site which shows every conceivable way of redirecting a website.

.htaccess File

If you have access to edit your .htaccess file (FTP or SSH access to your server) put this line at the top.  It will redirect the local url “/” (root) to the new location.  More on HTTP 301 here.  I’ve discussed this in more detail on a previous post.

Redirect 301 / http://yournewwebsite.net/

HTML Meta Tag

The example below will redirect a page to the new location after two seconds.  This code should be placed at the top of your index or default page.

<meta http-equiv="refresh" content="2;url=http://yournewwebsite.net">

PHP Redirect

This method is sort of a combination of the above two approaches.  It will perform an instant redirect and return HTTP 301 to the browser.  This code needs to be entered in your index.php file.

<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://yournewwebsite.net" );
?>

For examples of a large number of other possible redirects are available on webconfs.com.

One Year Anniversary: Random Image Selector 1.2.0

I can’t believe it’s been one year since the last major release of the random image selector.  Since the plugin’s initial inception last summer it has received a fair amount of attention garnering nearly 11,000 downloads.

Random Image Selector - Downloads Per Day

Random Image Selector - Downloads Per Day

I’m glad that it’s proven useful for people and there will be a major update coming out over the Christmas break to coincide with the WordPress 2.7 release.  This update will include a few bug fixes, a couple of minor feature changes and one significant addition.

Thanks to everyone who has downloaded the plugin, and to those who have left feedback on the blog!

Disable Anonymous Edits in MediaWiki

It didn’t take me forever to find this, but I felt it was simple enough that it bore re-posting.  If you’ve ever wanted to disable anonymous editing of articles in a mediawiki-based wiki (the ones that look & feel like wikipedia…) there’s a simple one-line fix:

In your LocalSettings.php file, add this to the bottom:
#Disable Anonymous Editing
$wgGroupPermissions['*']['edit'] = false;

It should be noted that this fix is for MediaWiki 1.5 and later. If you want some ideas on additional things that you can do with MediaWiki security, check out the MediaWiki Manual.