> ## Documentation Index
> Fetch the complete documentation index at: https://citodocs.prostack.host/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview URLs

> Test websites before going live with temporary preview URLs

We have a Preview URL tool available which can help you to test your websites before going live. This generates a temporary URL for your site, proxying through to your Prostack server without you needing to configure anything or switch your DNS.

This is a useful alternative to modifying `/etc/hosts` or similar methods of testing sites, and works on all devices, including mobile.

**We automatically generate preview URLs for all new Cito sites.** To view this, click the "Preview" button in the site's overview card.

<img src="https://mintcdn.com/prostackhosting/mdYxEEoAStQaBUbz/images/screenshots/previewsite.png?fit=max&auto=format&n=mdYxEEoAStQaBUbz&q=85&s=b84bb34bff6d74775caf25e1d8456375" alt="Preview Site" width="288" height="110" data-path="images/screenshots/previewsite.png" />

## Using the CLI

To generate a preview URL when creating a site via CLI, use the `-p` flag with `psnew`.

```
cito~ # psnew -d prostackdemo.com -t php -s -i -p
Using default PHP version: 8.2

Adding Domain prostackdemo.com with username demo
Setting up a new site at /home/demo/public_html
[+] prostackdemo.com preview URL is aixoq.preview.prostack.host
[+] Domain doesn't appear to be live here yet. Not going to try issuing a certificate.
[+] All done!
```

### For pre-existing websites

Visit [https://preview.prostack.host/](https://preview.prostack.host) and enter your server IP and domain name into the form, ensuring you check the captcha box.

This will generate a Preview URL and display it to you. Preview URLs do not expire. The URL prefix is randomly generated.

<Warning>
  **A note about WWW and non-WWW**

  Websites commonly use either non-www (e.g. `domain.com`) or www (e.g. `www.domain.com`) and redirect one to the other.

  When you add a preview URL please ensure you use the correct, non-redirecting version. If you try to add a Preview URL that simply redirects, it will not work.
</Warning>

## Caveats and gotchas

There are a few caveats to using the Preview URL system that need to be considered:

* Preview URLs modify HTTP headers on the fly. Some headers are stripped or changed (for example to prevent search engine indexing).
* If you have an IP restriction on your site this may not behave properly due to the way the Preview URL system works.
* Your site *must* be SSL-enabled and support SNI to work. If SSL is not enabled, it will not work. The certificate does not need to be valid.

The Preview URL tool works on non-Cito servers as well, including cPanel.
