Redirects Example with Payload CMS
This is an example repo that showcases how to implement redirects into your Payload CMS.
Getting Started
- Clone this repo
cdinto the directory and runyarnornpm install- Copy (
cp) the.env.examplefile to an.envfile - Run
yarn devornpm run devto start the development server - Visit
http://localhost:8000/adminto access the admin panel - Login with the following credentials:
- Email:
dev@payloadcms.com - Password:
test
- Email:
Frontend Development
To get the front-end side started up - open the nextjs folder that is along side cms. Follow the instructions there to get started. You can use this repo as a backend for the frontend and see for yourself how it all works together.
Usage
Once booted up, some instructions on how to view redirects working in action will be immediately available to you on the home page along with some basic content on corresponding pages.
- On initial start up, a
Homepage and aRedirectpage will be seeded into thepagescollection. - A couple redirects have also been seeded into the
redirectscollection as examples. Accessing the url/old-internal-linkwill redirect you to theRedirect Page. While accessing the url/old-external-linkwill redirect you to the custom urlpayloadcms.com. - The redirects plugin is very easy to use. Once added, all you need to do is input a
From URLand aTo URL!