A
A
Arthur A.2017-09-16 11:31:02
JavaScript
Arthur A., 2017-09-16 11:31:02

302 redirect using js, how?

You need to redirect from the main page to the internal page
C www.site.com
to
www.site.com/page.html
PS. No access to htaccess file
Thanks in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RidgeA, 2017-09-16
@RidgeA

response headers are sent by the server.
on js, you can only redirect to another page, but you can’t put a 302 status in any way.
location.href = "http(s)://www.site.com/page.html"

A
Alexander Alexandrov, 2017-09-16
@BraveHeart

window.location.replace("http://www.site.com/page.html");

  • https://developer.mozilla.org/ru/docs/Web/API/Loca...
  • www.contentforest.com/seo-tools/redirect-checker

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question