Page 2 of 2
Re: running old standard website and the new MX website together
Posted: Thu 04 Aug 2022 2:09 am
by apple8
Something must be working. When I leave the "s" off realtimegauges.txt I get 404 error messages every 5 seconds.
Code: Select all
2022-08-04 11:44:04.132391 [INFO] [597544] [T0] [2001:8003:3606:5f00:91bb:b16b:181a:34d3:63002-H3:B89C98B9B8EF6A85-740#APVH_blazingcomet.com:443] File not found [/home/blazingc/public_html/404.shtml]
2022-08-04 11:44:04.132371 [INFO] [597544] [T0] [2001:8003:3606:5f00:91bb:b16b:181a:34d3:63002-H3:B89C98B9B8EF6A85-740#APVH_blazingcomet.com:443] File not found [/home/blazingc/public_html/weatherMX/realtimegauge.txt]
Putting the correct filename in gives no errors but the file does not update.
Edit: also noticed that if I leave the .htaccess file active and the realtimegauges.txt file updating from extra web files, the gauges page will not update until .htaccess has a name change.
Re: running old standard website and the new MX website together
Posted: Thu 04 Aug 2022 6:00 am
by freddie
Looks like your .htaccess is working okay. If I access
https://blazingcomet.com/weatherMX/realtimegauges.txt I see data. I kept refreshing until the data changed, and it appears to be changing regularly - certainly at 30 second intervals. What is your realtime interval set to?
Re: running old standard website and the new MX website together
Posted: Thu 04 Aug 2022 8:47 am
by apple8
Yes, realtime interval is set to 30 seconds. Is the file supposed to be rewritten in the directory directory C1 or just accessed. If I delete the realtimegauges.txt it doesn't reappear until I turn off htaccess and turn on with Extra Web Files.
Re: running old standard website and the new MX website together
Posted: Thu 04 Aug 2022 11:37 am
by freddie
The file isn't rewritten - the HTTP request that accesses the file is rewritten.
So if you have a request come in for
https://blazingcomet.com/weatherMX/C1/r ... gauges.txt then the request is rewritten on the fly to
https://blazingcomet.com/weatherMX/realtimegauges.txt. Or it might be the other way around, I can't remember which way round you have it set up.
You should have MX writing realtimegauges.txt to a single location. You will then need the .htaccess file in the second location to contain a rule that says "any request for realtimegauges.txt in this location should be rewritten to request the realtimegauges.txt file in the other location (where the file actually is)". As far as I can tell, this is what you have set up and it appears to be working for me (as at 11:25 UTC). The only thing I really noticed is that your web server is occasionally taking a long time to answer the request (from both locations, so nothing to do with .htaccess) so perhaps you won't see every change every 30 seconds reflected in your gauges page.
Re: running old standard website and the new MX website together
Posted: Thu 04 Aug 2022 1:14 pm
by apple8
Thanks freddie, I feel sure I have right as you describe but no joy so I am missing something somewhere.
I not experiencing any delay here but the server is local to me and a request from the UK could be an explanation for an occasional delay.
Re: running old standard website and the new MX website together
Posted: Thu 04 Aug 2022 3:11 pm
by apple8
Well, maybe a little progress. I found that on the iPhone I have two pages open for gauges, one working and one not. On closer inspection one includes www. after https://
This was apparently ok when the realtimegauges.txt was uploaded but not with a .htaccess in play.
Can I have both with a .htaccess file or is there a preference for one or the other. Changing pages in the menu doesn’t change that part of the address. I’ll have to look at that later on today, it’s 1:00am and working from bed on a phone is limiting.

Re: running old standard website and the new MX website together
Posted: Thu 04 Aug 2022 5:15 pm
by freddie
apple8 wrote: ↑Thu 04 Aug 2022 3:11 pm
Well, maybe a little progress. I found that on the iPhone I have two pages open for gauges, one working and one not. On closer inspection one includes www. after https://
This was apparently ok when the realtimegauges.txt was uploaded but not with a .htaccess in play.
If you use paths instead of URLs in your RewriteRule then you should be able to get around this.
For example, change:
Code: Select all
RewriteRule ^realtimegauges.txt$ https://blazingcomet.com/weatherMX/realtimegauges.txt [NC,L]
To this:
Code: Select all
RewriteRule ^realtimegauges.txt$ /weatherMX/realtimegauges.txt [NC,L]
But substitute whatever you've got in the right hand side of your actual rule, rather than just copy/pasting the above.
Re: running old standard website and the new MX website together
Posted: Thu 04 Aug 2022 9:16 pm
by Phil23
Not sure what happened to my main one, but all PHP stopped a week or so back.
Turned out to be these extra lines that the Hosting Provider had added to the end or the file
Code: Select all
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php71” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-alt-php71___lsphp .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Removed them & it was all Ok.
If you need to save a bit of typing, here's what I have in my .._../new directory.
Not sure if I posted it in completion earlier or not.
Code: Select all
# This prevents web browsers or spiders from seeing your .htaccess directives:
<Files .htaccess>
deny from all
</Files>
RewriteEngine On
RewriteRule ^realtimegauges.txt$ http://weather.inverellit.com/realtimegauges.txt [NC,L]
RewriteRule ^airquality.json$ http://weather.inverellit.com/airquality.json [NC,L]
RewriteRule ^alldailydegdaydata.json$ http://weather.inverellit.com/alldailydegdaydata.json [NC,L]
RewriteRule ^alldailyhumdata.json$ http://weather.inverellit.com/alldailyhumdata.json [NC,L]
RewriteRule ^alldailypressdata.json$ http://weather.inverellit.com/alldailypressdata.json [NC,L]
RewriteRule ^alldailyraindata.json$ http://weather.inverellit.com/alldailyraindata.json [NC,L]
RewriteRule ^alldailysolardata.json$ http://weather.inverellit.com/alldailysolardata.json [NC,L]
RewriteRule ^alldailytempdata.json$ http://weather.inverellit.com/alldailytempdata.json [NC,L]
RewriteRule ^alldailywinddata.json$ http://weather.inverellit.com/alldailywinddata.json [NC,L]
RewriteRule ^alltempsumdata.json$ http://weather.inverellit.com/alltempsumdata.json [NC,L]
RewriteRule ^availabledata.json$ http://weather.inverellit.com/availabledata.json [NC,L]
RewriteRule ^dailyrain.json$ http://weather.inverellit.com/dailyrain.json [NC,L]
RewriteRule ^dailytemp.json$ http://weather.inverellit.com/dailytemp.json [NC,L]
RewriteRule ^graphconfig.json$ http://weather.inverellit.com/graphconfig.json [NC,L]
RewriteRule ^humdata.json$ http://weather.inverellit.com/humdata.json [NC,L]
RewriteRule ^pressdata.json$ http://weather.inverellit.com/pressdata.json [NC,L]
RewriteRule ^raindata.json$ http://weather.inverellit.com/raindata.json [NC,L]
RewriteRule ^solardata.json$ http://weather.inverellit.com/solardata.json [NC,L]
RewriteRule ^sunhours.json$ http://weather.inverellit.com/sunhours.json [NC,L]
RewriteRule ^tempdata.json$ http://weather.inverellit.com/tempdata.json [NC,L]
RewriteRule ^wdirdata.json$ http://weather.inverellit.com/wdirdata.json [NC,L]
RewriteRule ^websitedata.json$ http://weather.inverellit.com/websitedata.json [NC,L]
RewriteRule ^winddata.json$ http://weather.inverellit.com/winddata.json [NC,L]
Re: running old standard website and the new MX website together
Posted: Fri 05 Aug 2022 1:53 am
by apple8
Ok looks like this is all sorted now, thank you all for your assistance.

Re: running old standard website and the new MX website together
Posted: Fri 05 Aug 2022 10:28 am
by freddie
apple8 wrote: ↑Fri 05 Aug 2022 1:53 am
Ok looks like this is all sorted now, thank you all for your assistance.
Would you like to share what changes you made to get it to work? Then others facing similar problems will be able to find the solution.
Re: running old standard website and the new MX website together
Posted: Sat 06 Aug 2022 5:56 am
by apple8
freddie wrote: ↑Fri 05 Aug 2022 10:28 am
Would you like to share what changes you made to get it to work? Then others facing similar problems will be able to find the solution.
Well, I had done a review in my mind and admit to a few basic errors. Mostly the answers are in previous posts but putting it into “mind pictures” for myself this is how I see it. Please correct me if it is misleading.
Firstly I had to understand where the file comes from and goes to. In reality it doesn’t go anywhere, the request is to fetch the data from its current location. It is not rewritten in the subdirectory as a file which is what I had been expecting. So when I didn’t see the file I thought it wasn’t working. Secondly when I refreshed the page, because there was “www” in the address (not readily apparent in the address bar until selected) it didn’t work. The suggestion to check the error file on the server gave a hint to what was and wasn’t working. In fact sometimes it did actually work but I wasn’t smart enough to look in the right spot for the results.
I try to visualise how it all works so this is my take on what goes on.
With the .htaccess file in the same (sub)directory as the html files, the first part of the line below tells the request “if your looking for this file then go to the second part of the line because that is the address where that file resides”.
Code: Select all
RewriteRule ^realtimegauges.txt$ https://blazingcomet.com/weatherMX/realtimegauges.txt [NC,L]
Because of the “www” problem freddie suggested I use the line below which basically says “if your looking for this file it’s upstairs in the parent directory.
Code: Select all
RewriteRule ^realtimegauges.txt$ /weatherMX/realtimegauges.txt [NC,L]
I initially just worked with the realtimegauges.txt until I got it right than added Paul’s complete list of files.
Re: running old standard website and the new MX website together
Posted: Sat 06 Aug 2022 11:01 am
by freddie
That's pretty much what I thought you had done, but it's nice to see it spelled out for other users to understand. Thank you for the summary.