Showing posts with label wordpress. Show all posts
Showing posts with label wordpress. Show all posts

Tuesday, April 28, 2009

WordPress: Disable Canonical URL Redirection Plugin

If you've got WordPress redirecting the browser to a URL, only to cause Apache (or whatever you are running as a web server) to redirect back to the original URL, you've got to disable the canonical URL redirection in WordPress. You can do this by saving the following to a PHP file in the plugins directory and activating it via WordPress.

<?php
/*
Plugin Name: Disable Canonical URL Redirection
Description: Disables the "Canonical URL Redirect" features of WordPress 2.3 and above.
Version: 1.0
Author: Mark Jaquith
Author URI: http://markjaquith.com/
*/

remove_filter('template_redirect', 'redirect_canonical');
?>

Changing my WordPress blog domain

The WordPress guys and my co-worker who made some mods on it made it difficult to move our blog from the staging environment to the production environment. As the domain name is different, I had to fix up the post GUID links using string replacement in the PHP file, as I didn't want to change the database on the live site (our PHP files are version controlled, but the data on the DB server is not). I did have to change the URL in the options table in the DB for 2 rows 'cos WordPress would always redirect me to the staging environment's domain name.

After getting the blog all patched up, I finally did a Google search to figure out how other WordPress bloggers moved their blogs, which brought me to this article:
http://codex.wordpress.org/Changing_The_Site_URL

Sunday, April 19, 2009

WordPress Mod: Authenticate via ASP.NET


I hooked up a WordPress blog to authenticate via ASP.NET. It's wicked, I tell you! After hacking through the WordPress source code, the integration was quick and easy from both the PHP and ASP.NET sides. The purpose of the integration was to deal with differences in hash algorithms, so we wouldn't have to create user accounts with completely different passwords.

We still would have to build a component on the ASP.NET side to push profile changes and new user accounts into WordPress. I'm wondering if MS SQL Server can connect to MySQL and update the data from within a trigger.