Guides
Tutorials
Pop Tags

Redirects

Add redirects and rewrite rules to your projects

To configure redirects or rewrite rules for your Webpop projects, go to the project dashboard and use the "Redirects" tab. There you'll see a text editor that lets you configure both redirects and rewrite rule in a simple format.

Setting up basic redirects is dead simple:

/home /
/blog/my-post.php /blog/my-post
/news /blog
/google https://www.google.com

Just list the original path followed by the new path or URL.

Status Codes

You can specify the HTTP status code for the rewrite. The default is 301 which will do a permanent redirect.

/home / 301
/my-redirect / 302
/pass-through /index.html 200
/ecommerce /store-closed 404

When the status code is 301, 302 or 303 BitBalloon will redirect to the target url. With any other status code BitBalloon will render the target url with the specified status code. This means that you can define rewrite rules as well as redirects by specifying 200 as the status code.

Using Placeholders

You can use placeholders in the origin and target paths:

/news/:year/:month:/:date/:slug /blog/:year/:month/:date/:story_id

This would redirect a url like /news/2004/02/12/my-story to /blog/2004/02/12/my-story

Splats

An asterisk indicates a splat that will match anything that follows:

/* /index.html 200

Will serve the home page for any path with 200 as status code. This can be really useful for angular apps or other one-page apps using history pushstate. You can use the splat in your rewrites or redirects like this:

/news/* /blog/:splat

This would redirects paths like /news/2004/01/10/my-story to /blog/2004/01/10/my-story

Matching on Query Parameters

You can also match on query parameters:

/blog post=:slug /blog/:slug

In this case the path /blog?post=my-blog-post would redirect to /blog/my-blog-post

Continue to Uploading Files »