Yahoo hosting, no htaccess, and permalinks
January 21, 2009 @ 3:08pm
by Rob Sanchez
So everyone wants clean permalinks these days; those search engine friendly URLs are everywhere (even on our own site!), and made ubiquitous by Wordpress and other CMSes. The usual technique is to use Apache’s mod_rewrite module and an htaccess file to re-write the URLs (see here). But what if you can’t use an htaccess file? Well, I found out recently that Yahoo Small Business hosting does not allow htaccess files, at all, and I had to find a solution for that.
The solution for me? PATH_INFO, an environment variable in Apache, which is basically extra “information” at the end of a file path/URL. So if you have a URL like “www.xyz.com/index.php/permalink/” the PATH_INFO would be “/permalink/”. In PHP, it’s available in the $_SERVER global:
<?php
$path_info = explode('/', $_SERVER['PATH_INFO']);
// start parsing $path_info however you see fit
?>
Now, we already had a custom engine for using handling the mod_rewrite output, and I was able to use that parsed URL data and put it into our system. And have some nice-looking permalinks. There was a small compromise in having that extra “/index.php” in the URL, but I think it is still worth doing and better than no clean permalinks at all.
Tags
apache, htaccess, mod_rewrite, path_info, permalinks, PHP, yahoo
Comments
Obama’s New Whitehouse.gov
January 20, 2009 @ 12:06pm
Updated — January 20, 2009 @ 1:51pm
by Rob Sanchez
If you haven’t noticed yet, the new White House website debuted today. It has a modern, classy look, similar to the Obama campaign website. The site features a blog; not sure if President Obama himself will be blogging, though. It also looks like the site will host a weekly video address from the President. Looked at the source code, and yes, they are using my favorite, jQuery! Nicely done.
Tags
Comments
Using Template Tags In Wordpress Widgets
January 1, 2009 @ 6:23pm
by Rob Sanchez
When working on our Wordpress theme here, I was looking for a way to create a more custom widget than the default Categories widget, without having much know-how when it comes to Wordpress plugin design. But Google comes to the rescue: this great tutorial from Lonewolf Online on how to create a simple, custom plugin w/ widget. Then you can go crazy with template tags in widgets, even if you are not a pro with plugin creation.









