How can you make the page.html page initially load on the server, and not according to the standard index.html. I read that somehow through the .htaccess file, but I don’t know what specifically to write in it, tell me who knows.
- Question: Isn't it easier to rename page.html -> index.html? - Jakeroid
- @Jakeroid is not simpler, of course, for several reasons! - Palmervan
2 answers
Add the following line to the .htaccess file
DirectoryIndex page.html index.html
The file itself is at the root of the site.
Essentially something like this in the same htaccess:
DirectoryIndex page.html index.php RewriteRule ^page\.html$ index.html [L] RewriteRule ^page\.html$ index.php [L] UPD:
At the root is the file htaccess.txt, what do you need to do with it? It needs to be renamed to .htaccess! How to do it? If the file is on the server, then in any FTP manager convenient for you. If you open the file locally, click File-> Save As-> File Type to specify how all the files and enter the name of the file .htaccess-> Save and drop the file htaccess to the root.
Open the htaccess file in a convenient editor and find the line
RewriteEngine On After it make
DirectoryIndex page.html index.php Next, find the line
RewriteRule (.*) index.php Replace with the following
RewriteRule ^page\.html$ index.html [L] RewriteRule ^page\.html$ index.php [L] RewriteRule (.*) page.html ZY if something does not work, comment!
- So you just need to copy the code and paste the file into the root directory? And the result should appear immediately or have some chips? I stumble for the first time and am not oriented at all, so the question may not be correct - Fairlooli
- oneread the UPD in my reply in a few minutes! - Palmervan
- I understand that the question in question is not about an existing
.htaccess. so perplexed. - ikoolik - @ikoolik as a rule in Joomla this file needs to be created from the finished htaccess.txt If the TS indicated in the .htaccess question, this does not mean that he has already done what I described above, because I indicated that I only read about it! - Palmervan
- Yes, I re-created the .htaccess file, the problem arose from the encoding, now everything works in the unix encoding, thanks to everyone who helped !!! - Fairlooli