Skip to content

sopnopriyo/react-www-redirect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React-www-redirect

npm

⚠️ Security note ⚠️ - This element provides a client-side option when server-enforced www redirects are not possible. Please don’t use this if you can configure the server.

The element redirects the current page of your React Application to www, unless the page is loaded from a web server that is running on localhost.

Installation

Using npm:

npm install --save react-www-redirect

Update your index.js file as below:

import WWWRedirect from 'react-www-redirect';

// you can just wrap your entire app to redirect it to the equivalent www version
// for example:
// http://example.com/    =>    http://www.example.com/

// you can also use a "disabled" prop to dinamically disable it
// <WWWRedirect disabled={...}>

class WWWApp extends React.Component {

  render() {
    return (
      <WWWRedirect>
        <App />
      <WWWRedirect/>
    );
  }
}

Author

Shahin Alam

github/sopnopriyo

About

The element redirects the current page of your React Application to www

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published