Answer the question
In order to leave comments, you need to log in
How are pages made without ".html" and without "/" at the end and without using root folders?
actually need instead of site. com/mamki.html and instead of site. com/patriarch/ whatever site. com/prnhb
Answer the question
In order to leave comments, you need to log in
appropriate web server options.
see the documentation for your server. nginx and apache have slightly different implementations.
in general, the names and extensions of the file to the web server to the light bulb, It's
just convenient and clear that *.html is sent directly to the sufferer, and *.php is passed through the php interpreter, but in the general case it is not necessary, you can configure it and vice versa :)
root - "/" and "/index.html" will automatically show the same thing
if it's essential that always only "/" and never "/index.html", then you can, for example, redirect or rewrite.
In htaccess do
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ http://www.site.ru/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question