Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 08, 2016, 05:58:21 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: files contents in folder to contents of a file- keep the same name  (Read 1944 times)

mateek

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 72
    • View Profile
    • GetAnd.com
    • Donate to Member
I've got a website I'm moth-balling, so all entrants to the site by a bookmark or favorite to a certain folder and file need to be redirected to the new file location.  I've created redirect html on the index pages.  Now I want to take a copy of the contents of the redirection code and put them in every file in the folder, but have the file names retained.

I was searching but couldn't find anything like this.  Has anybody come across anything that would do this?

One small problem...What would you name this if it gets created as a snack???  Maybe "Website Forwarder" but that's not very revealing of the actions this actuate.

I saw an icon that would fit nearly perfectly at Skrommel's page, this for ShortCutter.  Maybe putting the arrows in a tighter circle actually inside the the folder's boundaries.
Stop war: GetAnd.   Mobile edition: AndAnd.

db90h

  • Coding Snacks Author
  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 481
  • Software Engineer
    • View Profile
    • Bitsum - Take control of your PC
    • Read more about this member.
    • Donate to Member
And after re-reading (I originally thought you were talking about bookmarks saved in your browser, and maybe you are, I don't know for sure)...

If Apache is your web server you could use a mod_rewrite rule to redirect all accesses to the web server to a new location. The rule(s) would be placed in .htaccess. Google it for info.

db90h

  • Coding Snacks Author
  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 481
  • Software Engineer
    • View Profile
    • Bitsum - Take control of your PC
    • Read more about this member.
    • Donate to Member
But to copy a file to every folder could be easily done in BATCH or any scripting language ... To answer the question.

mateek

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 72
    • View Profile
    • GetAnd.com
    • Donate to Member
db90h,

Yes when I said 'bookmarks and favorites' I was referring to those in the browser.  I've dealt with the .htaccess file only a handful of times but I want to use the redirect page I've already designed.  It's a slightly fancy html file that says to paraphrase 'this page has moved, please make new bookmarks when you land on the new page.  Redirecting in 25 secs.'

Actually, I've been working on an open source Bible, so the files in the folder are dGenesis.html, dExodus.html, dLeviticus.html, dNumbers.html, etc on down the line.  My hosting provides very good statistics, and many readers are entering the website in that particular folder by those file names.  Until a year or so ago, they were coming in on one of those more often than through the home index!  They are going to be redirected to the Table of Contents page for the Bible on the new website through the html redirect I've written.  I want to 'multiply' the one html redirect page into many with each of those file names.

I'd love a little program that allowed you to "Browse" to a file name in a box up top as the master file, and fill it's contents into every file in a folder I select, but keep the file names.

My proficiency in writing batch files doesn't make it in that regard.  Thanks though.  Have you or anyone heard of a program that would save me a lot of manual renaming?
Stop war: GetAnd.   Mobile edition: AndAnd.