Answer the question
In order to leave comments, you need to log in
How to redirect all urls with? to the main page of the site (details in the description)?
Good evening, is there an attempt to redirect all urls with ? on the main page of the site, but there are nuances.
Here is an attempt to implement, by itself does not work:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{THE_REQUEST} \?
RewriteCond %{REQUEST_URI} !.css$
RewriteCond %{REQUEST_URI} !.js$
RewriteRule ^(.*)$ http://%{HTTP_HOST} [R=301,L]
Answer the question
In order to leave comments, you need to log in
if the file exists, then this is the answer 200ok?
then you feel free to
check in nginx I would not recommend checking in .htaccess, without saying that it cannot be done without crutches.
RewriteCond %{QUERY_STRING} !^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.(css|js)$ [NC]
RewriteRule ^ / [R=301,L]
In this case, the request ? will remain. If you do not need to save it, then add "?" to the slash in the last line: RewriteRule ^ /? [R=301,L]And because you call the blink function in a loop (in general, you need it without brackets ), and in general such a construction will not work correctly.
for (var i = 0; i < li.length; i++) {
setInterval(blink, 1000);
}
The first argument of the setInterval() function is written incorrectly! How to
It is more logical not to create a bunch of intervals, but to change the class of the parent, i.e. at ul. And depending on what class the parent has, the children will blink. This way you only need one interval, not a bunch per child.
Posted the code on jsfiddle.net
var ul = document.getElementById('blink'),
li = ul.getElementsByTagName('li');
for(var i = 0; i < li.length; i++) {
(function(el, i) {
setInterval(function() {
blink(el, i)
}, 1000);
})(li, i);
}
function blink(el, i) {
el[i].classList.toggle('cls');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question