RSS

Forums/New Features

Redirects can now use wildcards

Michael Slater Oct 10

When you are moving a site to Webvanta, you can easily set up redirects (Settings > Redirects) so the old URLs will be redirected to the new ones.

Redirects are also useful when you want to publish simple URLs that may be different from the actual URL of the page.

We've now extended the redirect capability so you can use wildcards. This is not enabled by default, however; you must add a Global Setting (Settings > Global Settings) named admin.redirect.regex and set the value to "true" (don't enter the quotes). (There's a slight performance penalty for enabling this feature, which is why it is not enabled by default.)

Once you've added this setting, you can use * (match any number of characters) and ? (match any single character) wildcards.

For example, you may have a series of pages on the old site that you want to redirect to a single page on the new site. The "catch URL", for example, might be:

specials*

which would match specials, specials-summer, specials123, etc.

You could redirect to:

specials

This assumes that you don't want to replicate each of these old pages on the new site, but just keep all those old URLs going to something useful - perhaps a page that lists all the current specials.

Or perhaps the same page existed in two locations on the old site: directory-one/pagename and directory-two/pagename. You could redirect from:

*/pagename

to:

new-site-directory/pagename

Limitations

This feature is currently limited to the * and ? wildcard characters; you cannot use other regular expression syntax, despite the suggestive name of the setting that enables this feature.

You cannot capture part of the catch URL and insert it into the redirect URL. So you can redirect any number of URLs to a single new page, but you cannot use it to map a group of pages to another group of page. To do this, you'll need to create a redirect for each URL.

If there are other capabilities that you desperately need, let us know and we'll add them to our to-do list.