Replicate your Wordpress site

Most customers who are interested in Site Replication feature uses Wordpress so let's explain how it should be replicated. There are 2 ways, easier and harder. For the sake of an example lets assume your wordpress is at https://www.domain.com/

 

Easier way

- replicated pages at https://www.domain.com/SOMETHING/affiliateID

Set up in this case is easy, just follow these steps:

  • create the Site Replication banner
  • set Replicated site URL to be at custom location https://www.domain.com/SOMETHING (for example ref, partner, site or whatever you like)
  • set Replicated site files to external URL https://www.domain.com/
  • set Files to process to *.html,*.htm,*.php,DIR_INDEX
  • click the Generate .htaccess for this location button and copy the provided code
  • go to your Wordpress files, create the SOMETHING folder in the root of your site and in that SOMETHING folder create a .htaccess file and into it paste the code generated by Post Affiliate Pro.

That is it, if your server supports mod_rewrite and mod_proxy the way we use it then the replication works for you now.

Harder way

- replicated pages at https://www.domain.com/affiliateID

  • create the Site Replication banner
  • set Replicated site URL to be at custom location https://www.domain.com
  • set Replicated site files to external URL https://www.domain.com/
  • set Files to process to *.html,*.htm,*.php,DIR_INDEX
  • click the Generate .htaccess for this location button and copy the provided code
  • go to your Wordpress files and edit the .htaccess file in the root of your Wordpress installation. Paste the code generated by Post Affiliate Pro above the WP default code.
If you are using Wordpress permalinks, it is the default setting so most people do, then you need to get the list of all your WP page URLs, for that you can use for example this plugin. You will need to extract the page names/identifications so that you can add them to conditions in .htaccess to prevent the Site replication redirection for these pages. The resulting .htaccess would look something like this and would include all your pages:
# Start Post Affiliate Site Replication Code 
RewriteEngine on 

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} !^/index\. 
RewriteCond %{REQUEST_URI} !^/wp-admin
RewriteCond %{REQUEST_URI} !^/wp-login
RewriteCond %{REQUEST_URI} !^/our-services 
RewriteCond %{REQUEST_URI} !^/benefits 
RewriteCond %{REQUEST_URI} !^/about 
RewriteCond %{REQUEST_URI} !^/contact 
RewriteCond %{REQUEST_URI} !^/faqs
RewriteCond %{REQUEST_URI} !^/login
RewriteRule ^([^/]+)/(.*) https://URL_TO_PAP/scripts/page.php?a_aid=$1&a_bid=8f68703d&a_file=$2 [L,P,QSA] 

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} !^/index\. 
RewriteCond %{REQUEST_URI} !^/wp-admin
RewriteCond %{REQUEST_URI} !^/wp-login
RewriteCond %{REQUEST_URI} !^/our-services 
RewriteCond %{REQUEST_URI} !^/benefits 
RewriteCond %{REQUEST_URI} !^/about 
RewriteCond %{REQUEST_URI} !^/contact 
RewriteCond %{REQUEST_URI} !^/faqs
RewriteCond %{REQUEST_URI} !^/login
RewriteRule ^([^/]+) https://URL_TO_PAP/scripts/page.php?a_aid=$1&a_bid=8f68703d&a_redir=Y [L,P,QSA] 

# End of Post Affiliate Site Replication Code

# here have to continue original WordPress htaccess content

NOTE: URL_TO_PAP and also the id 8f68703d  after 'a_bid' is going to be generated by PAP when setting up the site replication banner. 
×