Identical files displaying differently in localhost |
Guru master
|
I don't fully understand the problem at the moment, but a few comments to get started:
html pages do not normally execute PHP on the web server. Whilst you can change the web server to execute PHP in html files (eg in site .htaccess), best practices normally indicate you should not. If for any reason your web server does not execute the PHP in the html file, it will instead send the source code to the browser and that could be considered a security risk. So you probably should really use index.php and not index.html and for the site that does execute PHP in the html file, maybe review the site settings and turn that off. It is possible that one of your sites is set to execute PHP in html files and the other site is not? If the page does not disable caching, you will have to force reloads on the page to see changes and that might be confusing. Whilst html meta can be used to partially disable caching, it is better to use http headers to disable caching. You can disable caching using either Apache web server settings (eg server level or in site .htaccess) or PHP code (just ask if you would like some code). Also, to clarify something on the html side of things; if you use Apache rewrites you can have a URL that ends in .html but in reality that file does not exist and the rewrite will instead use a PHP file to process the URL and send output. Many frameworks use rewrites to send all URL's for non-existent files through index.php |
||||||||||||
|
|
Still not sure what happened.
Thanks for the response, plugnplay. Just switched to index.php as you said and is working. |
||||||||||||
|
|
Switching to the .php extension surely is the better option. If you want to understand why it works in one project and not in the other one, search for a file named .htaccess in the root of the project where it works (or in a directory above that) and look out for one of the following lines (or both):
This can also be defined in the Apache configuration. Do you work with different vhosts ("local domains")? Then it's probably defined in X:\xampp\apache\conf\extra\httpd-vhosts.conf (replace X with the letter of the drive where XAMPP is installed). Cheers, Jan |
||||||||||||||||
|
Identical files displaying differently in localhost |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by