E
E
Ed12017-04-29 19:54:10
PHP
Ed1, 2017-04-29 19:54:10

What does it mean and what does it do?

(In .htaccess code) What does it mean

RewriteRule ^index\.html /index.php
and what does it do?
And what does it mean anyway
\.html
?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D3lphi, 2017-04-29
@Ed1

This code redirects all requests from <site domain> /index.html to <site domain> /index.php . \.html - in this case, the backslash plays the role of an escape character. Since in regular expressions (Read more here: Regular expressions ) the symbol . plays the role of <any character>, then in order for it to be perceived by the program as a dot character, and not as an element of the regular expression, it must be escaped. Actually, the \ character does this. That is, after parsing, the web server will receive the RewriteRule ^index.html /index.php string

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question