When reloading pages on my server, they alternate between the current version and either an older version or a 404 error. I’ve tested this on multiple browsers.
You can check here:
eg. https://www.promostuff.com.au/admin/test01.php
And this is what I get in developer tools when the 404 error is generated:
I’m using PHP / Apache.
When testing on my localhost the page always loads normally. Has anyone got an understanding of what might be happening?
You may be thoroughly familiar with Docker while developing PHP sites running on a public hosting server but I'm wondering about these steps I'm pasting --
Especially regarding where a page is pulled from depending on whether it is accessed directly as in directly from a Link (as I did when I clicked your link here) or when a Reload is performed after the page has been accessed in the browser. Then it seems you could see page elements pulled by the server from another folder.
Specifying project settings while inside the Docker "extra folder" environment while the .htaccess file is written with Routing might be the cause of your inconsistencies.
Tip: you might be wondering why there are three levels of folder — websites
, default
and public
— instead of just having the public
directory with the files in it.
The environment is configured to host multiple websites from different folders within the created websites
directory. To create a new website that’s available at https://mysite.v.je/
, take the following steps:
- Create the directory
mysite
inside the websites
directory.
- Create the directory
public
inside the mysite
directory.
- Place your web-accessible files inside the
websites/mysite/public
directory. For example, the file in websites/mysite/public/phpinfo.php
will be accessible at the URL https://mysite.v.je/phpinfo.php
.
Any directory you create inside the websites
directory is treated as a subdomain of v.je
. If no subdomain is specified and you just visit v.je
, it will load the website from the default
directory.
As we’ll see later on in the book, it’s good practice to keep certain files outside the public
directory for security, which is why each website has a public
directory.
From --
https://swavedigest.com/2022/03/01/setting-up-your-php-development-environment-with-docker/
Thanks for that. Although it’s a bit to digest for a novice like me, this is definitely something I can investigate further.