User Guide

Geo-Targeted CSS with Cloudflare Redirect Rules Documentation

Introduction

AssureGeo is a WordPress plugin designed to work with Cloudflare’s geo-tagging and redirect rules for serving different CSS files based on the visitors’ countries. The plugin provides a user-friendly interface to manage and edit five different CSS files: a default file and four alternative files.

Installation

  1. Download the AssureGeo plugin.
  2. In your WordPress admin panel, navigate to Plugins > Add New > Upload Plugin.
  3. Upload the AssureGeo plugin zip file and click “Install Now.”
  4. Activate the plugin after the installation is complete.

Configuration

  1. In your WordPress admin panel, navigate to Settings > AssureGeo.
  2. The AssureGeo settings page will be displayed with an interface to edit the default and alternate CSS files.

Using the Plugin

  1. Select the desired CSS file from the dropdown menu (default.css, css1.css).
  2. Edit the content of the selected CSS file in the provided textarea.
  3. Click the “Save CSS File” button to save your changes.
  4. To copy the URL of the selected CSS file, click the “Copy URL” button. This is the URL to be used in your Cloudflare redirect rules.

 

Uninstalling the Plugin

  1. In your WordPress admin panel, navigate to Plugins > Installed Plugins.
  2. Deactivate the AssureGeo plugin.
  3. Click the “Delete” link below the deactivated plugin.

Upon uninstalling the plugin, you will be prompted with a confirmation to either keep or delete the five CSS files. Press “OK” to keep the files, or “Cancel” to delete them.

Setting Up Cloudflare Redirect Rules

To fully utilize the AssureGeo plugin’s capabilities, you need to set up Cloudflare redirect rules to serve the appropriate CSS files based on the visitor’s country. Follow these steps to create the rules:

  1. Log in to your Cloudflare account and select your domain.
  2. Navigate to the Rules app.
  3. Click on “Create Page Rule.”
  4. In the “If the URL matches” field, enter the URL pattern for your default CSS file. For example, https://yourdomain.com/wp-content/uploads/AssureGeo/default.css
  5. Click “Add a Setting” and choose “Forwarding URL” from the dropdown menu.
  6. Set the “Status Code” to 301 (Permanent Redirect).
  7. In the “Forwarding URL” field, enter the destination URL based on the visitor’s country. For example, you can replace the default.css in the URL with css1.css for visitors from a specific country.
  8. Click “Add a Setting” again and choose “Country” from the dropdown menu.
  9. Select the desired country for which the rule should apply.
  10. Click “Save and Deploy” to activate the rule.

Repeat these steps to create additional redirect rules for other countries and corresponding CSS files.

Tips for Managing CSS Files

  1. Use descriptive comments in your CSS files to help you remember which styles are intended for specific countries or regions.
  2. Keep a backup of your CSS files, as changes made in the AssureGeo plugin will overwrite the existing content in the files.
  3. Test your site thoroughly after making changes to the CSS files to ensure that the styles are applied correctly for each targeted country.

Troubleshooting

  1. If the custom CSS is not being applied to your site, check the URL in your Cloudflare redirect rules to ensure it matches the URL of the CSS file in the AssureGeo plugin settings.
  2. If you still encounter issues, check the file permissions of the CSS files on your server. The files should have read and write permissions for the web server to be able to serve and update them.
  3. For further assistance, consult the plugin documentation or contact the plugin author at hello@assurewp.com.

Please note that the usage guide is for the specific version of the plugin you provided. Future updates may change or add new features, and this guide may need to be revised accordingly.

Frequently Asked Questions

What is the AssureGeo plugin?

The AssureGeo plugin is a WordPress plugin designed to work with Cloudflare’s geo-tagging and redirect rules. It allows you to serve different CSS files based on your visitors’ countries, enabling you to customize the appearance of your site for different regions.

How expensive is CloudFlare?

The free version allows up to 5 redirect rules. For most uses of this plugin, the free version should suffice.

How do I install the AssureGeo plugin?

The AssureGeo plugin is a WordPress plugin designed to work with Cloudflare’s geo-tagging and redirect rules. It allows you to serve different CSS files based on your visitors’ countries, enabling you to customize the appearance of your site for different regions.

How do I edit the CSS files in AssureGeo?

After installing and activating the AssureGeo plugin, navigate to the AssureGeo Settings page in your WordPress admin dashboard. From there, you can select the CSS file you want to edit, modify the content in the provided textarea, and save your changes.

How do I use Cloudflare's redirect rules with the AssureGeo plugin?

With Cloudflare’s redirect rules, you can set up conditions based on your visitors’ countries to serve alternative CSS files. Create a redirect rule in your Cloudflare account to map a specific country to a particular CSS file, which will replace the default CSS file for that country’s visitors.

Does the AssureGeo plugin affect my site's performance?

The AssureGeo plugin is designed to be lightweight and have minimal impact on your site’s performance. However, it is essential to follow best practices for optimizing your site, such as minimizing your CSS files, using a CDN, optimizing images, implementing caching, and using a lightweight theme.

How do I uninstall the AssureGeo plugin?

To uninstall the AssureGeo plugin, navigate to the ‘Plugins’ screen in your WordPress admin dashboard, locate the AssureGeo plugin, and click ‘Deactivate.’ Once deactivated, you can delete the plugin files by clicking ‘Delete.’

Can I use the AssureGeo plugin without Cloudflare?

The AssureGeo plugin is specifically designed to work with Cloudflare’s geo-tagging and redirect rules. While you can still use the plugin to manage multiple CSS files, its primary functionality relies on Cloudflare’s features.

What happens to my CSS files when I uninstall the AssureGeo plugin?

When uninstalling the AssureGeo plugin, the CSS files will be deleted. Save them using your file manager before deleting the plugin.