K
K
KG2016-09-12 17:07:02
Apache HTTP Server
KG, 2016-09-12 17:07:02

How to make friends 2 parts of the code?

Hello, I can’t make friends with the following 2 parts of the code:
1) Redirect from http to https

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

2) Removes at the end of the extension address
RewriteCond %{REQUEST_URI} ! \.html$
RewriteCond %{REQUEST_URI} ! /$
RewriteRule ^(.*)$ $1.html

I try different combinations, but in the end 500 error. Who fumbles in the backend please help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2016-09-12
@miraage

.htaccess is very well described here for most needs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question