For example, when I want to access www. domainA. com1.js, I will automatically redirect 301 to www. domainB. com2.js. How to do it? For example, when I want www.domainA.com/1.js to be accessed, I will automatically redirect 301 to www.domainb.com/2.js. How to do it?
Reply content:
For example, when I want www.domainA.com/1.js to be accessed, I will automatically redirect 301 to www.domainb.com/2.js. How to do it?
301 redirection is a response from the server, so it can only be implemented by setting the server or using the script language of the server. Toapache
For example, you can configure.htaccess
File implementation. the add statement is as follows:
redirect 301 /i.js www.domainB.com/2.js
The implementation of the script languagephp
For example, the implementation statement is as follows:
header('Location: http://www.domainB.com/', true, 301);exit;
Others, suchjavascript
Andmeta
The redirection of tags should not belong to the permanent page orientation (that is, 301 redirection ).
However, you can usejavascript
301 redirection.javascript
Store the page information to be redirectedcookie
And thenphp
Readcookie
To determine whether to perform 301 redirection, but this method is still inseparable from the support of the backend.
Are 301 redirects possible using javascript or jQuery?