PHP Title and Meta Tag Generator

Filed Under Technical | Comments Off

Many thanks go to Hawkee.com for putting up the code for a php meta tag and title generator  per request.  I’ve been trying to figure out how to generate page titles and meta description tags without having to edit individual pages in an editor one at a time and then upload by FTP, and this will simplify the process (once I get it down how to use it).

It seems there can be a problem with both the non-www and the www. versions of a domain turning up in search engine listings - like the credit for links being split or the worst possibility being a duplication issue. It’s a precaution worth taking, there’s certainly no harm in it.

No way could it be made to work on some of my sites, so I contacted the hosting support people. I heard nothing back, and ended putting in the code in that I’d seen recommended at forums and that was working with sites on other servers. The automated way through the control panel apparently wasn’t working with that server configuration. A week later I heard from support telling me that it was working, closing the ticket.

This is what the mod_rewrite code in .htaccess looks like that works:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

And yes, I have redirected pages to example.com - more than once. :-)