Skip to content

Overview

This page lets you select when a rule is going to run. Rules can be executed for all pages or of only a limited set of pages.

When to enable the rule

On all pages

The rule will be executed without any condition, on all pages of the site.

Disable for now

The rule is entirely disabled and will never run. It is, however, preserved, and you can enable it back at any time.

With some conditions

The most powerful option: when you select it, more options will appear to let you define when the rule will run.

Run on these pages

The simplest and most powerful. Enter the address of the page(s) where this rule should run.

In its simplest form, just enter an exact URL, relative to the site, such as /blog/a-new-seo-extension: the rule you are preparing will only run on that exact page.

Now it becomes more interesting when you start using the {*} and {?} wildcard characters.

  • {*} will match any string, from to 1 to many characters
  • {?} will match any single characters

With these special strings, rules can run on a very specific set of pages. Here are a few examples:

/blog/{*}

Rule will run on all pages in the blog section but not others. For instance, it will run on /blog/new-seo-extension but not on /news/something-happened

/blog/{*}/seo/{*}

Rule will run on all pages within the blog section that are in the seo sub-section. For instance, it will run on /blog/joomla/seo/new-seo-extension but not on /blog/joomla/dev/modern-seo-extension

Regular expressions

You can also use regular expressions in the Run on these pages input by directly entering your regular expression in that field. You must however use the ~ character as your regular expression delimiter.

An example input would be: ~/contact-us/.*~

Setting up a rule for multiple pages

You also can make a single rule run for multiple pages, even if there is no common pattern where you can use wildcards characters, {*} and {?}.

This is done by listing these separate URLs, one per line. For instance, you can enter these various URLs where the rule should run:

4SEO setting up multiple URLs a rule should run on

and assuming the rule is a redirect, redirect all of them to /contact.

When using multiple URLs, you cannot use wildcards characters

As it would not be possible to manage all cases of using {*} and {?}, if you elect to create a rule wich runs on multiple URLs as in the screenshot above, you cannot use {*} or {?} anywhere in the Run on these pages field or on the What to do tab of the rule.

To use wildcard characters:

  • list only one URL specification on Run on these pages field
  • do not use wildcard characters in redirect or canonical target fields

If the rule is for a redirect, and only simple URLs with no other condition to trigger the redirect (component, specific categories, etc.), then it's probably better to use an alias instead. Aliases are faster to execute by 4SEO than a full rule, but can only handle simple redirects conditions and target.

Do NOT run on these pages

You can also ensure the rule will not run on some specific pages. Use the same format as for when setting pages the rule should run on:

  • you can enter multiple URLs to exclude
  • URLs to exclude can use wildcard caracters ({*} and {?})
  • URLs to exclude can be regular expressions.

Exclusions specification are applied after inclusive ones.

Disregard query string

To decide whether this rule should run on the current page, 4SEO will compare the address of the page to your specification. When doing, this setting will decide whether the query string (the part after the ?) should be dropped before comparing.

Assume you have decided the rule should run on page: /blog/a-new-seo-extension

  • If Disregard query string is Enabled, the rule will run for both /blog/a-new-seo-extension and /blog/a-new-seo-extension?fbclid=123465

  • If Disregard query string is Disabled, the rule will still run for /blog/a-new-seo-extension but not on /blog/a-new-seo-extension?fbclid=123465 as that query string is not part of your specification.

If any of the page addresses you enter starts with /index.php?, the Disregard query string will be automatically disabled.

If an address starts with index.php? then it's basically an address with only a query string, so if query string is disregarded, the rule will never be executed.

Run for these languages

Directly select one or more of the Joomla languages you want this rule to run for.

Run for these components

Directly select one or more of the Joomla extensions you want this rule to run for.

Run for these views

After you selected one or more components to run the rule on, you can be more specific and only run the rule on some values of the view variable.

The view variable refers to what Joomla uses to decide how to display your content and is part of the non-SEF URL.

A non-SEF URL is in the form index.php?option=com_conten&view=article&id=12 and is what Joomla uses internally to know what it should show on a page. The non-SEF URL is also what appears in the Link input field when you create a menu item.

You can enter multiple views, one per line. Leave that input field empty to allow all views.

Example with Joomla articles

To trigger a rule for Joomla regular content but only when showing an article and not a category, enter article in the Run for these views field.

To trigger the rule for both the display of articles and individual categories, use:

article
category

This will trigger the rule when showing actual content but not, for instance, on the new article creation page, or on the Featured page.

Do NOT run for these views

Use this field to enter a list of views you do NOT want the rule to be triggered on. This will come in handy if you want the rule to trigger on all but a one or two views for a component.

For instance, we may want a rule to run on all pages showing regular content except on the form view, which is for creating or editing an article.

Run for these categories

Directly select one or more of the Joomla categories you want this rule to not run for.

Do not run for these categories

Directly select one or more of the Joomla categories you want this rule to not run for.

If a category is listed in both Run for and Do not run for, it will be excluded.

Run based on custom field value

Custom fields are a very powerful feature of Joomla 3 and more recent, which you can use to attach your own data to content items.

4SEO lets you trigger any rule based on the actual value of a any custom field for the page being displayed.

This is done in 2 steps:

  • chose wich custom field you want to use
  • tell 4SEO for which value of the custom field the rule should run

Custom field and value selector in 4SEO rule

4SEO offers a large list of comparison operators to chose from. However, not all of them make sense all the time. For instance, if you chose an Image field type, using a Greater than comparison does not really apply. 4SEO will try to make sense of it, but results may vary.

The custom field selector shows you all the custom fields defined on your site. You can type a few letters in the input field to quickly select the one you want.

Run rules between dates

You can instruct 4SEO to run this rule only after a specific date, until a specific date or between two dates.

Click and select a date in either field.

  • If you pick a date in both fields, the rule will run between those dates.
  • if you select only the first date, the rule will run after that date
  • if you select only the second data, the rule will run until that date.