Hi Guys, Newby here. I was wondering if anyone could figure out a mod_rewrite of some sort that would automatically insert the H1 of the article into the Title tag. I have generic title tags across tens of thousands of pages and I would like to try and make the titles the same as the H1, automatically. Any help would be great. Thanks!! Hendy
I'm sorry, I think I didn't explain the problem and solution I was looking for correctly. I am looking to add whatever the text that is located in the header tag, which happens to be an h1, and programmatically have that post this text in the title tag.
To the best of my knowledge, you cannot do this with Apache without creating a module to do this kind of task. However, you can do this programmatically if you are using something like php and some kind of template system. In simple terms, grab the title of the document and insert that into the <title></title> field in the head of the page which is created for Apache to send out. If documents come from a database and the title, which goes between the <h1></h1> tags is in a separate field, capture that and replace <title></title> with <title>the title found in the database</title>.