Simple PHP URL rewrite

One thing I did for dmb is making dodosmb.com/profile/username work with my profile.php script. Normally without the help of .htaccess, you can use the value of the path info from the global variable

$_SERVER['PATH_INFO']

For example, create a php file named profile.php and in there put:

<?php echo $_SERVER['PATH_INFO']; ?>

Then upload the file and load it with yourServerPath/profile.php/dodo. The script will print out

/dodo

In my profile.php, I get the user by doing a simple sub string command like:

$user = substr($_SERVER['PATH_INFO'], 1); // this will get rid of the leading slash

This allows me to feed users to my profile.php by using the url dodosmb.com/profile.php/username

That’s still not pretty enough; it’s better if I can do dodosmb.com/profile/username. This is where .htaccess rewrite comes in. Here’s a great tutorial for .htaccess rewrite rules. To accomplish my goal, I used the following rewrite rules in my .htaccess:

RewriteEngine on
RewriteRule ^profile/([A-Za-z0-9]+)/$ /profile.php/$1
RewriteRule ^profile/([A-Za-z0-9]+)$ /profile.php/$1

Funny cartoons and images

These are cartoons and images found in my old pe backup. They were under the fun section but I don’t want to create a page for them any more so I will select the ones that still amuse me and put them in a post instead :)

pure-essence.net is back

What happened?
If you weren’t here when pure-essence.net went down, here’s a summary of the story.
PE got sponsored by http://edgewebhost.com/ in early 2006. The hosting was fine until mid May 2007. My site just all the sudden disappeared from the face of the internet and the owner of edgewebhost was nowhere to be found. I’ve tried everything I could to contact the owner. Emailed their support & admin, used their ticket system. I even went on webhostingtalk.com and found the owner & pmed him. I got absolute no response. I had no up-to-date backup of the site when it went down. The last backup I had was only to Jan 2006. I would have lost all my entries from Jan 2006 to May 2007. Thank goodness for webArchiver and Alberto, I was able to restore much of my loss. Web Archiver had my site logged up to May 2006 and Alberto sent me entries of my blog in his google feedreader from Dec 2005 to April 2007. Although I still lost entries and contents, without their help, it would have been worse.

What’s restored? What’s new?
If you are a regular visitor, you know I started PE way back in 2001. The site has gone through many evolutions in six years. Overall I want to stick to contents that work for me. I will remove the gallery section of the site and tentatively add a tutorial section. I might bring back some of the tutorials I wrote for Dodo’s New World that are still heavily requested. None of the static sections are done however. They will take longer to be restored. I will work on them but I don’t make any promises. I have a very busy life right now :)

Thank you thank you thank you!
I want to thank everyone who emailed with suggestions, comforting words and tips while the site was down. I also want to thank nagaki from xfluro.com for giving PE a new and stable home. To all visitors, please continue your support for pure-essence.net, I will keep up the good work :)