Keep Pages Recent Script?

liunx

Guest
This is a two part question:<br /> 1. Is there an easy and safe (for TCH) script I can use to do a Un*x "touch" on my website files so they have a recent date? I'd like to do it about once per week, not all the time or even every day.<br /><br /> 2. Is there a reason this is not a good idea? I know crawlers at one time devaluate pages that haven't recently changed and I suspect they still do. Parts of my site are historical and don't have need to change so should I do this?<br /><br /> I know, I could use DW to add an extra space on my template and let it update everything but that's inefficient and I may start using alternative methods of web development thanks to the PHP gang and some of their ideas.<br /><br />Thanks<!--content-->
I don't know if it will help with the search engines, but there's no harm, that I know of.<br /><br />With php:<br /><!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->$date = date("j/n/Y");<br /><br />print $date;<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />More info and ways to format the function here:<br /><a href="http://www.php.net/manual/en/function.date.php" target="_blank">http://www.php.net/manual/en/function.date.php</a><!--content-->
I can't speak to whether it is a good idea or not. As for the how, why bother with a script to do a "touch" like effect when you can just use touch? <br /><br />You can set a cronjob in CPanel and once a day run this command:<br /><br />touch /home/username/public_html/*<br /><br />That will take care of all the files in the public_html directory. You would need to have a similar one for other directories if you wanted to include them.<br /><br />touch /home/username/public_html/otherdir/*<br /><br />etc.<!--content-->
Perfect! Thanks Rick!<br /><br />Surefire, would a php function such as that make it look like the date-last-modified is today to the web crawlers since it is a dynamic part of a static 3-month-old page? I'm still not sure how these things work but with the help here it's great learning about it!<!--content-->
The script just displays the date in a predetermined format.<br /><br />I have no idea how the various search engine spiders look at it. Sorry.<!--content-->
Don't apologize! This is, afterall, the script forum and the question of how has been answered - now it should probably move to the SEO forum to discuss the effect it has on the SEs. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
 
Top