If you are encountering the error message Error loading user 'index.html.var' instead of seeing a replicated site, the issue is that the affiliate parameter is missing. This can occur, for example, when you use the custom location setting for site replication and specify the same URL as your main site. Typically, you access your site at: https://yoursite.com/ and you may have also set this as the custom location for site replication. As a result, your affiliates will have links such as: https://yoursite.com/testaff
The code on your server (specifically, the .htaccess file) enables the replication to function—it reads the referral ID appended to https://yoursite.com/ and generates the replicated site. In this case, testaff would be displayed as the affiliate's site. However, when there is nothing after https://yoursite.com/, there is actually something hidden in the browser: index.html. The .htaccess code interprets this as index.html.var, assuming it is an affiliate (referral ID), and passes it to the replication script. The script then returns the error because there is no affiliate with the referral ID index.html.var.
How to Fix the Issue
To resolve this issue, you need to modify your .htaccess file slightly. Add the following lines below the RewriteEngine on line in your .htaccess file:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^index.html.var$ https://www.yoursite.com/PAP_directory_name/scripts/page.php?a_aid=general_affiliate_ID_Here&a_bid=replication_ID_here&a_redir=Y [L,P,QSA]Be sure to replace PAP_directory_name, general_affiliate_ID_Here, and replication_ID_here with your actual directory and ID values.
Alternative Solution
Alternatively, you can use the default page URL below (if you do not want to redirect to the default affiliate):
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^index.html.var$ https://www.yoursite.com/index.html [L,P,QSA]This will simply redirect any access to index.html.var to your main index.html page, rather than showing an error.