K
K
Konstantin2015-11-06 15:24:23
htaccess
Konstantin, 2015-11-06 15:24:23

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]

I add it to my .htaccess (changing the site address), but nothing works. I tested htaccess on redirects - everything works, so it's not about him.
Tell me, please, is it possible to change the url of static files? How to do it?
(creating folders and adding index.html there will not work, there are a lot of files and you are tormented to change the paths to styles and pictures in them ...)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question