Saturday, January 15, 2005

 

Frontpage 2003, .htaccess, and Search Engine Friendly URLs

Search engines have been historically unfriendly about indexing url's that contain query strings. This makes it hard for data driven websites to get noticed.

If your website is hosted on a *nix server with Apache, you may be able to use mod_rewrite.

Apache's mod_rewrite can take a url that looks like
http://www.yoursite.com/bookname/MobyDick
to the outside world and converts it to
http://www.yoursite.com/findbook.php?bookname=MobyDick

While the mod_rewrite gives you exactly the kind of url search engines are looking for, Frontpage will not publish or even recognize a website that contains mod_rewrite directives. The best way I have found around this problem is to keep two .htaccess files. One file has the rewrite directives and the other does not. Otherwise the .htaccess files are identical.

When I am ready to publish, I use my shell account to copy the no rewrite version over the true .htaccess file. The will cause the site to stop processing redirected requests for visitors, but it will resume after you publish and copy the rewrite version back.

Thanks
The Staff at BuyByMail.com

This page is powered by Blogger. Isn't yours?