Forum Moderators: phranque
I have a slightly different question relating to changing file names. I have searched a fair bit but all of the questions i have found are of the kind "how to serve dynamic pages as static"
My situation is this:
I have a website full of static pages in the form .html that are indexed by the Search Engines -
Now, i need to have these pages serving dynamic content - without disrupting their listing in the search engines, and having to make redirects. Ideally, it would be best if the SE's didnt know any changes are made. Is this possible? So it will be as follows:
page1.html changes to page1.php, but then appear again as page1.html
OR
page1.html stays as it is, but can somehow serve dynamic content without having to change and 'hide' the filename (a better option)
any advice or experience with this issue would be greatly appreciated
Thanks
PS - i am a total apache n00b :)
While we are not set up to write code on demand here, here's an example to get you started. After some research, you can modify it to suit your needs, and we'll be happy to answer specific questions if you have trouble.
With an example static page url of example.com/product/widget.html and a script invokation of /display.php?what=product&product=widget, it's simply a matter of doing something like this:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([^/]+)/([^.]+)\.html$ /display.php?what=$1&product=$2 [L]
Jim