Project 5 Day 38: I need to make the URLs from the old site work with the new site as well. Today we are going to do some work with Express and NodeJS keep all the URLs working.
See a professional front-end developer at work. Unscripted. Mistakes included.
Next.js 5: https://zeit.co/blog/next5
Project Repo: https://github.com/fus-marcom/franciscan-react
React: https://facebook.github.io/react/
Gitter: https://gitter.im/LiveCodingwithJesseFreeCodeCamp/
Twitter: https://twitter.com/JesseRWeigel
Youtube: https://www.youtube.com/c/JesseWeigel29
Instagram: https://www.instagram.com/jesse.weigel/
Code Editor: Visual Studio Code
VS Code Theme: Seti
Terminal: https://www.iterm2.com/
Project Management: https://trello.com
–
Learn to code for free and get a developer job: https://www.freecodecamp.com
Read hundreds of articles on programming: https://medium.freecodecamp.com
And subscribe for new videos on technology every day: https://youtube.com/subscription_center?add_user=freecodecamp
source
You could just use your Apache .htaccess file to permanently redirect old URLs to new URLs like so:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^photo/old-photo/?$ /photo/new-photo [NC,L,R=301]
Or you could use Nginx to redirect the old URLs if you use that web server.