V
V
Vayladion Gognazdiak2017-08-29 19:37:01
Apache HTTP Server
Vayladion Gognazdiak, 2017-08-29 19:37:01

What do these Apache rewrite rules mean?

Please explain to the stupid what these rules do in .htaccess

RewriteRule (.*) https://myfotos.cc/$1 [R=301,L]
RewriteRule ^(.*[^\/])$ /$1/ [R=301,L]
Redirect 301 /en/ https://myfotos.cc/
RewriteRule ^index\.html$ / [R=301,L]
RewriteRule ^/?$ "https\:\/\/myfotos\.cc" [R=301,L]

Redirect 301 /en/ https://myfotos.cc/
As far as I understand, when accessing */en/, there is a redirect to https://myfotos.cc

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2017-08-29
@shambler81

RewriteRule (.*) https://myfotos.cc/$1 [R=301,L]
All urls will add everything that was in brackets at the beginning, since the whole part of the url is in brackets at the beginning, they will add https://myfotos.cc/here_everything_that_was_before_this , but this rule will lead to a cycle.
any number of symbols in any quantity [^\/]is except / , then substitute all this instead of $1, then add a slash at the beginning and at the end, also an idiotic rule.
Redirect url /en/ to main https://myfotos.cc/
index.html to /
The beginning of the line with /and any one character - this will not work for some kind of nonsense.
He tries to redirect for some reason in quotation marks, although they are redirected to htts in the mod: which also has colons escaped, which the hell is not needed, two slashes are escaped, which are also not necessary, and the domain again with a slash and again quotes, in short, they wanted to do redirect to the main page with
https

S
Samarkand, 2017-08-29
@Samarkand

https://httpd.apache.org/docs/current/mod/mod_rewr...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question