I loaded a subdirectory with its own index.php, then created a link in index.php in the root, clicked on the link, and it goes to the subdirectory, but shows the subdirectory name in browser address bar.
I tried .htaccess both in root, and in subdirectory.
I had understood that, but not the direct linking, how am I going to load the pages in subdirectory then?
Hiding the subdirectory is my goal, but seems from your explanation that’s not technically possible, so I guess I have to think over how to go about structuring the site.
All URLs first pass through the server index.php and then directed to an internal router where the relevant URL data is extracted and then sent to the CMS/PHP Framework “Engine”. An excellent Application Flow Chart can be seen here:
I think most CMS/PHP Frameworks supply an optional .htaccess file can hide /index.php. Configuration file parameters may be finely tuned to completely remove .php extensions or to add the old standard .html file extension. Modern trend is to have no file extensions. Pretty URLs may also be configured to eliminate potential security risks when using $_GET parameters.
Most CMS/PHP Frameworks have caching available which automatically stores the the rendered web page. As you can see from the diagram, the routed URL first tests for the existence of a cached file and if it exists the cached file is rendered without loading a any Drivers, Models, Libraries, Helpers, Packages or Scripts.
Other advantages of using a single /index.php is that system updates are activated by setting the index.php->$system_path and if there if there are any problems then quickly revert back to the previous version. Online Development versions can run in tandem and eliminates ancient “Under Construction” pages.