I
I
Ilya Bykov2020-05-09 12:54:20
HTML
Ilya Bykov, 2020-05-09 12:54:20

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

5 answer(s)
A
Arseniy, 2020-05-09
@svarogpyc

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.

O
Oleg, 2020-05-09
@politon

Through .htaccess do

T
Type Programmer, 2020-05-09
@Oleg2002pr

Good afternoon! Try looking at the documentation for the .htaccess file. Looks like you can do it.)

N
ninja op op, 2020-05-09
@kur4chyt

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

Leave the page files with the .html extension, but you can enter just /page instead of /page.html in the browser URL

K
Karpion, 2020-05-10
@Karpion

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 question

Ask a Question

731 491 924 answers to any question