Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

node redirection

response.writeHead(302, {'Location': '/account/login.html'});
response.end();
Comment

node redirect

switch (req.url) {
    case "/":
      path += "index.html";
      break;
    case "/about":
      path += "about.html";
      break;
    case "/about-us":  // <--- redirection from /about-us to /about
      res.statusCode = 301;
      res.setHeader("Location", "/about");
      res.end();
      break;
    default:
      path += "404.html";
      res.statusCode = 404;
  }
Comment

PREVIOUS NEXT
Code Example
Javascript :: open json file in current directory python 
Javascript :: input change event in javascript 
Javascript :: Password checking regex 
Javascript :: javascript download string as file 
Javascript :: check if string contains word nodejs 
Javascript :: multiple connections to mongoose 
Javascript :: if statement es6 
Javascript :: hello world in jsp 
Javascript :: discord js duplicate channel 
Javascript :: xml to json api in asp.net 
Javascript :: remove all spaces from string javascript 
Javascript :: flutter text with icon 
Javascript :: react native regenerate android and ios folders 
Javascript :: js absolute value 
Javascript :: uppercase first letter of each word javascript 
Javascript :: express.json 
Javascript :: get only day from date in javascript 
Javascript :: jquery source disable right click 
Javascript :: update param in url jquery 
Javascript :: express search query template 
Javascript :: regex ranges 
Javascript :: javascript decimal to string 
Javascript :: ReferenceError: http Server is not defined 
Javascript :: jquery datetimepicker example code 
Javascript :: console.table javascript 
Javascript :: google sign up react npm 
Javascript :: simulate click jest 
Javascript :: document.write multiple lines 
Javascript :: jquery datatables get selected row data 
Javascript :: how to make slide js in owl carousel auto 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =