Forum Moderators: coopster
I don't know if this is possible but heres the story.
I run an ecom site, and currently all the pages are done by hand. if i add a new product I just load up the template, put the product details in, and a buy link (just a html link, which takes them to my cart, not Paypal cart btw).
However, I would like it if I could pull the contents from a database, basically the site is getting bigger, and I've ot something planned, that will be easier enough to do by hand, but maintaining will be hard and it would just be a lot easier from a database.
I don't want to chage my file system or get stung for having duplicate content, which would happen if I changed my files to .php.
What I would like to know is whether there is any way of pulling content from a SQL database,but maintaining the .html extensions?
Thanks in adavnce
AddType application/x-httpd-php .php .html
It will vary depending on how the host wants you to do it but try that for starters.
Another way that some people do this is with mod-rewrite. They rewrite all the html pages to php pages. I prefer using the apache config method myself.
Thanks for your reply - much appreciated.
I actually use a shared server - where I pay £20 a year and get 100mb space, 3gb bandwidth p/m etc.
So would the apache config file be accesible, or would my hosting company be able to do this.
So if i have a page called
blue-yellow-widgets.html
and my page was created on the fly from a data base called
blue-yellow-widgets.php
then the apache code thing would change it back to
blue-yellow-widgets.html
and the search engines (or anyone for that matter) wouldn't know it was happening.
Sorry to sound like a dim nut, but this side of things isn't where I usually dabble, so you're help is much appreciated.
AddType application/x-httpd-php .php .htmlline then what it does is run every .html file through php so if there are any
<?php?>tags in the .html file they will get parsed by php.
One last thing.
I can't see that these pages can be created on the fly, as they will be called
www.mydomain.com/catalogue/blue-yellow-widgets.html
If that page doesn't physically exist, then the user will get a 404.
A lot of dymaic pages i see are something like catalogue.php?Blue-Widgets, so you'll obviously get the right page.
Will the database have to create a page called blue-yellow-widgets.html, and then take the info from a database when the page is called on? Or is there some way it can be 'crated on the fly', as in when a user comes to the page.
Thanks again.