Cyclone3 Skin

301.conf

From Cyclone3 Wiki

Example

As your probably notice when reading the error emails, one of the problems of many web pages is the absence of links from the old times before-the-page-was-rebuilt. For solving these issues and fixing dead links there is the 301.conf file located directly in the domain.

For example, pages of domain.tld had contained the link "index.html". Certainly a lot of users have had the link in their bookmarks, it had been indexed by search engines, etc. After rebuilding the site it does not exist anymore, reporting a standard error - the 404 code. This prevents our site from being accessible via the well-known, now dead, link and links to our site being dumped from search engines (and content loss).

Solution & Usage

Cyclone3 supports automatic redirection with the 301 code (Moved permanently). However, this redirect is only concerned with our changes of rewrite links. So if automatic redirect in enabled and a user visits a link, which is now written in a different way, the user is redirected to the right link.

It is also possible in some service type files to prevent entry with specific variables and the user is redirected automatically.

Support for manual redirect is available using the code of 301 in the configuration file 301.conf

The syntax is following:

"regexp"= link
link = link
'type=type' = link

A fix for domaint.tld so that index.html leads to the home page:

/index.html= ?|?

Redirection to a different link:

/index.html = http://oldweb.com

An entry including regexp:

"^/index.html$" = http://oldweb.com/old-link

Note that Cyclone3 loads 301.conf automatically and immediately. This means that all the changes take effect right after saving 301.conf.

Format of the 301.conf file

/old/link.html = ?|?type=newtype
"^/old/" = ?|?type=default
"^/msoffice/" = -404
'type=nonexistent' = ?|?type=default