What are common pitfalls when setting up SSL for PHP applications like MediaWiki?

Common pitfalls when setting up SSL for PHP applications like MediaWiki include not properly configuring SSL certificates, not redirecting HTTP traffic to HTTPS, and not updating internal links to use HTTPS. To solve these issues, ensure that your SSL certificates are correctly installed, configure your server to redirect HTTP to HTTPS, and update all internal links to use HTTPS.

// Redirect HTTP to HTTPS
if ($_SERVER['HTTPS'] != 'on') {
    header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    exit();
}

// Update internal links to use HTTPS
$internal_link = str_replace('http://', 'https://', $internal_link);