# Different ways to redirect a URL

A quick guide on redirection with Apache, NGINX, or with plain HTML.

## Apache

Use the Apache Redirect directive, paste this in your `.htaccess` file:

```
Redirect 301 / https://clubmate.fi/
```

## NGINX

For more detail on how NGINX chooses a matching request block, see
[the guide to the `location` directive](/understunding-ngix-location-directive-and-redirects).

Paste this in your NGINX server block, or into a `nginx.conf` file in your
projects root.

```nginx
server {
  # Redirect this address
  server_name example.com;

  # ...to this address
  return 301 $scheme://example.net$request_uri;
}
```

## Using meta redirect

A more "lighter" method with timing. This goes into the `head` tag:

```html
<meta http-equiv="refresh" content="0; url=https://clubmate.fi/" />
```

That `0` is a time in seconds for how long the browser waits until doing the
redirect.
