Answer the question
In order to leave comments, you need to log in
Creating an HTML page without a .html tag?
Good afternoon guys, the question is this. I'm learning how to create websites...
There is such a question, I want to make a page in the /page/ format, and at the moment it has the name /page.html
How to do it, I understand that this is php. But I don't want to migrate my site to WordPress. Help explain. I am very grateful that you paid attention to my question :)
Site on html, css, js
Answer the question
In order to leave comments, you need to log in
Each slash is a directory to open a directory, i.e. address like /page/ you should have the following folder structure:
page/index.html
Thus, when you try to open /page with the correct server configuration, an index file will open (this is the standard configuration).
You can also pay attention to the server configuration, for example Apache → htaccess, it allows you to cut the extensions of opened files.
PS: in the first method, the file and its contents will be available both at /page and /page/index.html, so in the end you will have to combine the two methods so that there are no duplicates. And at some point you will come to PL \ Engines \ CMS, which take most of this hemorrhoids out of themselves.
Good afternoon! Try looking at the documentation for the .htaccess file. Looks like you can do it.)
Create a .htaccess file in the root of the site.
Write the following in it:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html-f
RewriteRule ^(.*)$ $1.html
I didn't understand what the "/page/" format is.
Web servers, when accessing a directory, can either list the files in that directory; or issue an index file. The index file can be set in the main settings file or in the .htaccess file - in this directory or higher. The default is usually index.html .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question