Skip to content

Redirections management

Redirecting is the act of sending a request for a given page to another, on the same site or another one. 4SEO rules-based redirect system is very flexible and lets you create many redirects, very easily.

For simple, one-to-one redirects, you should probably use an alias instead of a full-blown redirect rule. Aliases are simpler and faster - but are limited to simple and direct redirects. They cannot have trigger conditions or apply to multiple pages at once.

Start creating a redirect by going to the SEO Tools > Redirects page, then click on the New button in the toolbar.

When using a full page cache extension such as the Joomla Cache system plugin or a 3rd-party one, redirects rules may not work properly. This is because the cache plugin will respond with the cache data before 4SEO has a chance to check if any redirect rule applies and execute it. This can be worked-around - on Joomla 4+ only - by enabling the Check rules as early as possible under Tools | Redirects | Settings. Only enable this option if you need it, ie you use a full-page cache plugin, as there's a - small - performance penalty associated with using it.

Redirects configuration

To select which pages you want to redirect from, select With some conditions on the When to run tab of the rule creation page:

Sample condition to redirect a category to another

In this example, we have entered /old-category/{*} in the pages URL field. This will cause any request which URL starts with /old-category/ to be redirected.

This example triggers a redirect based on the URL but like all rules, you can also redirect based on a regular expression, on the Joomla component or a category, on a custom field value, or even only between 2 dates!

You can also enter several page URL specifications in that field - but some restrictions may then apply.

To learn more, see all the options to trigger a rule, any rule, on the When to run 4SEO a rule page.

Redirect types

You can specify the redirect type to be used when doing the redirect on the What to do tab:

Various redirect types available

In most cases, you should use the default: Permanent, which stands for permanent redirect and will use a 301 code for the redirect.

Other codes can be used in specific situations, when a redirect is only temporary for instance.

Google basically consider 301 and 302 codes equivalent in terms of passing signals

Redirect non-SEF URLs to SEF URLs

While in most cases you specify the target for a redirect, 4SEF can also perform a specific type of redirects automatically.

The To SEF URL redirect type is meant to allow one single thing: redirect a request for a Joomla non-SEF URL to its SEF equivalent.

A non-SEF URL looks like this:

index.php?option=com_content&Itemid=105&catid=8&id=3&view=article

non-SEF URLs are used internally by Joomla (it's actually the only type of URLs it understands). But for public links found on your site, these internal URLs are usually converted to their SEF counterpart, for instance:

blog/welcome-to-your-blog

By creating a redirect rule and selecting To SEF URL as the type, any request for a non-SEF URL that may come to your site will be redirected to the SEF, user-friendly one.

Please note that no matter what, some extensions will not be redirected from non-SEF to their SEF equivalent, to avoid breaking some pages. Here is the current list that 4SEO will not redirect:

com_ajax
com_acymailing
com_config
com_contenthistory
com_jce
com_media
com_menus
com_modules

Why would I need that?

non-SEF URLs are normally purely internal and never published on your site by Joomla. So they are really not an issue.

However, for various reasons it may be that both the SEF and non-SEF URL become visible - to search engines in particular.

In that case, this may be a minor SEO issue, and you may want to add a To SEF URL redirect url to be sure Google and others only take into account the nice, user-friendly version.

Why would I do NOT want that?

In some cases, redirecting all non-SEF URLs to their SEF equivalent may break some extensions expecting the URLs to never be SEF. Or extensions that do not support using SEF URLs at all.

In such case, you should not add a rule to redirect non-SEF URLs to SEF, or you should make sure to exclude these extensions from the rule When to run conditions.

Redirect target

Finally, enter a specification for where 4SEO should redirect the requests this rule applies to:

Sample redirect target

This example will redirect any URL from /old-category/{*} to/new-category/{*}.

The {*} symbol means any number of any character. The end result is that for instance:

  • /old-category/post-one will be redirected to /new-category/post-one
  • /old-category/post-two will be redirected to /new-category/post-two
  • /old-category/post-three will be redirected to /new-category/post-three

This only works this way because we used the {*} symbol on both the source and target URL specification.

Redirect query string

This setting will decide whether the query string should be appended back to the target URL when doing a redirect.

A query string is the part in a URL after the ? symbol. For instance, in https://weeblr.com/some-sample-page?var1=123&var2=345, the query string is var1=123&var2=345.

If enabled, any query string on the source redirect will be appended back after the redirect:

  • if enabled, /old-category/post-one?var1=123&var2=345 will be redirected to /new-category/post-one?var1=123&var2=345
  • if disabled, /old-category/post-one?var1=123&var2=345 will be redirected to /new-category/post-one