Web Analytics Made Easy -
StatCounter Is it possible to rename html file automatically - CodingForum


No announcement yet.

Is it possible to rename html file automatically

  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to rename html file automatically

    This is the first time I am posting a message on this forum. I am webmaster for a library. We update our homepage every week with new promotions. When I take time off, I create several weeks worth of index pages and name them as index_Feb30.html, etc. Then I ask my boss to rename the page to index.html on the monday of the week, so it overwrite the existing index page. Like this it also keeps the hyperlinks.

    I was thinking if I can write a java script function to check if the day is Monday(for example: Feb 30), then get index_feb30.html and rename the file to index.html. This way I don't have to ask anybody to do it.

    I thought about redirecting but that way I will loose the links.

    Please help. Let me know if there is anyother way of doing this.

    Thanks in advance

  • #2
    javascript can't alter anything on a file. Nut since your a webmaster you presumably got a server and server languages can alter things on files.


    • #3
      Any suggestion?

      Thank You. Do you have any suggestion?


      • #4
        What you can do is, make an index page with some php or asp, or whatever server side language is available that redirects the person to the appropriate page on the given date.