Forum Moderators: phranque

Message Too Old, No Replies

Single Dynamic Element

keeping the .html extension

         

fidibidabah

3:40 pm on May 3, 2004 (gmt 0)

10+ Year Member



Note: Please move this if it doesn't belong here, I have no idea where it should go.

I have a site where I need a single element to be dynamic on every page (almost), but I want to keep them all .html - Is there anyway to do this?

When I say 'single element' I mean a short line of text (maybe 3-5 characters?), and when I say 'dynamic' I mean that it's pulled from a table.

Does anyone have any ideas? (besides .htaccess and mod_rewrite, I don't know if I could figure that out, plus I dunno how the SERPs like it)

Any help would be appreciated :) Thank you.

Brett_Tabke

4:19 pm on May 3, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



How about using an iframe?

encyclo

8:33 pm on May 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could use a scripting language such as PHP, along with a database. In order to keep your .html file extension, you can add this to your root level .htaccess file:

AddType application/x-httpd-php .html

(The above assumes your server runs Apache.)

fidibidabah

11:29 pm on May 3, 2004 (gmt 0)

10+ Year Member



<iframe>
It would seem at first glance that this was the easy alternative that I had overlooked, but I'm not 100% positive how I would go about it. I've used iframe before, but not in a situation like this. Would I point it to a sort of anchor (I think that what they call it?), like iframe1.html#page28 and that would position the page correctly as to show the right number? I would imagine this would get messy as to making it compatitble with different browsers and resolutions, that's the only thing I'm thinking. If there's something else I'm overlooking, please let me know, thanks again mr tabke ;)

.htaccess
I would be using a comparitively inexpensive Shared Host. Do most/some hosts allow you to edit this file? I recall (vaguely maybe) possibly seeing this on some of my other hosts. I remember with some of them you have to upload your core content to like yourname.com/www/index.html and that would be accessed as yourname.com/index.html, and then there were a few files at the root level (maybe htaccess being one of them). I guess I'd just have to find a shared host tha t used apache ;) I'm sure that wouldn't be so hard. Correct me if I'm wrong. Also, is that generally ran on a windows box? The other thing, the reason I wanted to stay away from server-side scripting was purely for SERP/SEO/SEM purposes, would this .htaccess edit just effect the way it showed up, or would it actually change it 100% in a pure way? If you understand where I'm coming from... Besides that, I have very little experience in this field (i'm graphics/design/marketing kind of guy), but I have the books and things (jsp/asp/php), would it be encredibly hard for a reletively intelligent person to create a little database like this? I think i could handle it.. maybe ;)

Anyway, thanks again for your replys, I'm just very confused.

encyclo

11:49 pm on May 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most inexpensive shared hosts run Apache on Linux. Apache is rarely available on Windows machines, and Windows servers tend to be a little more expensive. If you don't need any Windows-specific technology like ASP or .NET, then a Linux-based host is a good solution. Most of these hosts allow you to use an .htaccess file - if you find that one doesn't, look for another host - there are loads of them about, and it is a very competitive market.

As for the database, you'd need to do some reading, but if you're not afraid to dig in you should be able to manage it. You can use a MySQL database - which is the most widely-available database accompanying Apache/Linux hosting packages. For the scripting language, I mentioned PHP, which is also available almost universally - but depending on your experience, you could also use Perl or Python, or JSP (if your host offers it - few of the cheaper hosting companies offer JSP).