I have been finding that my multi-site Wordpress setup described in this article has been working pretty well for me. I'm able to simultaneously host multiple Wordpress websites that are in development and present them to my clients independently.

Recently there was an issue where I wanted to upload a new theme that I had purchased. When I attempted to upload the theme's ZIP file I got this strange error:

The link you followed has expired

Huh?

I checked around and found that this problem is usually because of the default upload limitations settings in PHP. Because I ran into this problem I thought it might be helpful to show how this issue can be resolved when using the multi-site setup that I use.

How to Fix the "Link you followed has expired" Error

There are configurable limits that must be adjusted to allow for larger files like large, premium zipped themes to be uploaded in Wordpress. You can actually see what the current limit is by going to the Media > Add New page in Wordpress:

maximum upload size: 64MB
[Fig.1 - I've already increased my Maximum Upload Size to 64MB.]

Your Maximum Upload File Size might likely be set to 8MB.

To change this and other limitations we're going to change the virtual host settings for this site.

Setting Higher Limits Through The Virtual Host Config File

Find the virtual host configuration file that manages the website that you're working with. Remember that the virtual host configuration files are found at: /etc/apache2/sites-enabled/.

Suppose we want to edit the site: widgets.your-domain.com. In this case, find the file: /etc/apache2/sites-enabled/widgets.your-domain.com-le-ssl.conf

Side note: You may recall that we use Certbot to create an SSL-version of our website. Certbot creates a new SSL virtual host file and appends: -le-ssl.conf to the end of out web site's domain name.

Your file should look something like this:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    # The primary domain for this host
    ServerName widgets.your-domain.com
    # Optionally have other subdomains also managed by this Virtual Host
    DocumentRoot /var/www/html/widgets.your-domain.com/public_html
    <Directory /var/www/html/widgets.your-domain.com/public_html>
        Require all granted
        # Allow local .htaccess to override Apache configuration settings
        AllowOverride all
    </Directory>
    # Enable RewriteEngine
    RewriteEngine on
    RewriteOptions inherit

    # Block .svn, .git
    RewriteRule \.(svn|git)(/)?$ - [F]

    # Recommended: XSS protection
    <IfModule mod_headers.c>
        Header set X-XSS-Protection "1; mode=block"
        Header always append X-Frame-Options SAMEORIGIN
    </IfModule>

SSLCertificateFile /etc/letsencrypt/live/widgets.your-domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/widgets.your-domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

To increase the file upload limitations we add these lines to the first Directory block you see in the file:

        php_value upload_max_filesize 64M
        php_value post_max_size 64M
        php_value max_execution_time 300
        php_value max_input_time 300

You can clearly see that the maximum file upload size has been changed to 64MB. While we're at it you see that we also increase the execution time for our script.

Your config file should look like this now:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    # The primary domain for this host
    ServerName widgets.your-domain.com
    # Optionally have other subdomains also managed by this Virtual Host
    DocumentRoot /var/www/html/widgets.your-domain.com/public_html
    <Directory /var/www/html/widgets.your-domain.com/public_html>
        Require all granted
        # Allow local .htaccess to override Apache configuration settings
        AllowOverride all
        php_value upload_max_filesize 64M
        php_value post_max_size 64M
        php_value max_execution_time 300
        php_value max_input_time 300
    </Directory>
    # Enable RewriteEngine
    RewriteEngine on
    RewriteOptions inherit

    # Block .svn, .git
    RewriteRule \.(svn|git)(/)?$ - [F]

    # Recommended: XSS protection
    <IfModule mod_headers.c>
        Header set X-XSS-Protection "1; mode=block"
        Header always append X-Frame-Options SAMEORIGIN
    </IfModule>

SSLCertificateFile /etc/letsencrypt/live/widgets.your-domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/widgets.your-domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

Reload your Apache:

sudo systemctl reload apache2

… and you're on your way! You should notice that the maximum upload file size has increased in the Wordpress admin pages. You should be able to upload your theme with no errors now.

Conclusion

A small configuration adjustment to Apache's virtual host configuration file is all that is needed to correct the ambiguous "Link You Followed Has Expired" error.