Answer the question
In order to leave comments, you need to log in
How to remove html from URL?
There were many posts on this topic I read and tried but this helped me in part.
I clear the cached files each time so that Cloudflare will download a new version of those files from my web server. Also in the browser I reload the page with a new load Ctrl + Shift + R.
I added changes to the .htaccess
file
. For example, if you write it down.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
<a href="contact.html">Contact</a>
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ <b>mysite.ru</b>/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ /$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html
Answer the question
In order to leave comments, you need to log in
I found a solution to my problem!
I made the following entry in the .htaccess file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
<a href="contact">Contact</a>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question