Answer the question
In order to leave comments, you need to log in
How, when opening the static page site.ru/about.html, the beautiful CNC site.ru/about/ was displayed in the address bar?
Good afternoon!
There is a site that consists of static html documents: about.html, contact.html, etc.
It was necessary to make "beautiful" CNCs like site.ru/about/ , site.ru/contact/
I found here on toster the following example of directives for .htaccess, which, according to the description, should have converted the url
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ http://site.ru/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question