V
V
Vkok2019-04-22 20:14:12
htaccess
Vkok, 2019-04-22 20:14:12

Which instruction in .htaccess is responsible for showing pages without .html?

AddDefaultCharset UTF-8
AddHandler application/x-httpd-php .php .html
####
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https:// %{HTTP_HOST}%{REQUEST_URI} [L,R=301]
####
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.alp-sity.ru$ [NC]
RewriteRule ^(.*)$ https://alp -sity.ru/$1 [R=301,L]
####
RewriteRule ^(.+)/index\.html$ /$1/ [R=301,L]
####
RewriteEngine on
RewriteBase /
RewriteCond %{ THE_REQUEST} ^[AZ]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ https://alp-sity.ru/$1 [ R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
Action php5.4- script /cgi-bin/php5.4.cgi
AddType php5.4-script .php
ErrorDocument 404 /404.html
#########################

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-04-22
@boch112

RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ https://alp-sity.ru /$1 [R=301,L]

Makes a 301 redirect from /file.html to /file
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]

Makes an internal redirect from /file to /file.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question