# How to setup url redirection on Vecel

Setting up URL redirection on a Vercel project is quite straightforward. Vercel allows you to define rewrite and redirect rules in a configuration file called `vercel.json`. Here's how you can set up URL redirection:

1. **Create a** `vercel.json` file: If you don't have a `vercel.json` file in the root directory of your project, create one.
    
2. **Define redirect rules**: Inside `vercel.json`, you can define redirect rules using the `"rewrites"` property. Here's an example of how to redirect from one URL to another:
    
    json
    
    Copy code
    
    `{ "rewrites" : [ { "source" : "/old-url" , "destination" : "/new-url" , "status" : 301 } ] }`
    
    * `"source"` is the URL path you want to redirect from.
        
    * `"destination"` is the URL path you want to redirect to.
        
    * `"status"` is the HTTP status code for the redirection. `301` indicates a permanent redirection. You can also use `302` for temporary redirection.
        
3. **Deploy your changes**: After adding the redirect rules to `vercel.json`, commit your changes and deploy your project to Vercel. Vercel will automatically detect the `vercel.json` configuration and apply the redirect rules during deployment.
    
4. **Testing**: Once the deployment is complete, test the redirection by visiting the old URL (`/old-url` in the example). It should redirect you to the new URL (`/new-url` in the example).
    

That's it! You've set up URL redirection on your Vercel project. You can add more redirect rules as needed by adding additional objects to the `"rewrites"` array in `vercel.json`.
