Jump to content

Recommended Posts

Hi all,

 

I have another good one for you all. lol. I have a script on my website that I run once a day to update my listings from various datafeeds that change on a day to day basis. During this time my website, if only for 5 mins, looks a bit of a mess with duplicate products, error messages etc.

 

I was wondering if there's a way you could implement something into the below "Update" script that at the start will redirect customers to another page explaining that the website is updating and to check back soon, and then reinstate the original homepage at the end of the script

 

<?php

// MERCHANTS
echo file_get_contents("http://www.malegroomingfordummies.co.uk/controlPanel/setInStock.php");

// SET
echo file_get_contents("http://www.malegroomingfordummies.co.uk/controlPanel/setPrice.php");

?>

 

Any ideas people?

 

Many thanks,

yeah but the other page would have to redirect back to the first page.

And the user would have to instigate a return back to this page because-I assume you want them to read that the site is being updated. On the second page just let them read your message and then have a link below it saying return to homepage.

 

on page1 you could do:

-------------------------------

$page = "/nextpage.php";

 

echo "<html><body onload=\"window.location='$page'\">";

 

echo file_get_contents

("http://www.malegroomingfordummies.co.uk/controlPanel/setInStock.php");

 

echo file_get_contents("http://www.malegroomingfordummies.co.uk/controlPanel/setPrice.php");

 

echo </body></html>

in root of your serwer create page update.html

and in .htaccess file put

RewriteEngine on
RewriteRule !(update.html$) /update.html

this all request redirect to update.html

 

Cron Job is way too messy as can't stipulate exactly how long the update script will run for etc. I'm intrigued by this Rewrite business.

 

Let's just pretend the page I want displayed when my "update.php" script is running is called "alternativePage.php".

 

Am I right in thinking I would put in

 

RewriteEngine on
RewriteRule !(update.php$) /alternativePage.php

 

Is this right?

One more question and then I will leave you all alone as I will be heading to bed... as .htaccess is new to me, where am I uploading this to. My main directory with index.php, the folder alongside the update.php.

 

I am aware of all the trickery involved in uploading and changing the file itself.

 

How can I change this code to do so that while update.php is running, all other requests divert to alternativePage.php.

 

Many many thanks guys,  :P

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.