Configuration of the Linkvalidator extension

You can find the standard configuration in EXT:linkvalidator/Configuration/page.tsconfig.

This may serve as an example on how to configure the extension for your needs.

Minimal configuration

It is recommended to at least fill out httpAgentUrl and httpAgentEmail. The latter is only required if $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'] is not set.

config/sites/my-site/page.tsconfig
mod.linkvalidator {
  linktypesConfig {
    external {
      httpAgentUrl = https://example.org
      httpAgentEmail = noreply@example.org
    }
  }
}
Copied!

TSconfig Reference

You can set the following options in the TSconifg of a site, for example in file config/sites/my-site/page.tsconfig or in the global page TSconfig file packages/my_sitepackage/Configuration/page.tsconfig of your site package.

You must prefix them with mod.linkvalidator, for example mod.linkvalidator.searchFields.pages = canonical_link.

searchFields.[key]

searchFields.[key]
Type
string
Path
mod.linkvalidator.linktypesConfig.searchFields.[key]

Comma separated list of table fields in which to check for broken links. LinkValidator only checks fields that have been defined in searchFields.

LinkValidator ships with sensible defaults that work well for the TYPO3 core, but additional third party extensions are not considered.

config/sites/my-site/page.tsconfig
# Only check for "bodytext" in "tt_content":
tt_content = bodytext
Copied!
Default values: EXT:linkvalidator/Configuration/page.tsconfig
pages = media,url
tt_content = bodytext,header_link,records
Copied!

linktypes

linktypes
Type
string
Path
mod.linkvalidator.linktypesConfig.linktypes
Default
db,file

Comma separated list of link types to check.

Possible values:

db
Check links to database records.
file
Check links to files located in your local TYPO3 installation.
external
Check links to external URLs.

This list may be extended by other extensions providing a custom linktype implementation.

Changed in version 13.0

The default was changed to exclude "external" link type.

linktypesConfig.external.httpAgentName

linktypesConfig.external.httpAgentName
Type
string
Path
mod.linkvalidator.linktypesConfig.linktypesConfig.external.httpAgentName
Default
TYPO3 LinkValidator

Add descriptive name to be used as 'User-Agent' header when crawling external URLs.

linktypesConfig.external.httpAgentUrl

linktypesConfig.external.httpAgentUrl
Type
string
Path
mod.linkvalidator.linktypesConfig.linktypesConfig.external.httpAgentUrl
Default
(empty string)

Add descriptive name to be used as 'User-Agent' header when crawling external URLs.

Add URL to be used in 'User-Agent' header when crawling external URLs.

linktypesConfig.external.httpAgentEmail

linktypesConfig.external.httpAgentEmail
Type
string
Path
mod.linkvalidator.linktypesConfig.linktypesConfig.external.httpAgentEmail
Default
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress']

Add descriptive email used in 'User-Agent' header when crawling external URLs.

checkhidden

checkhidden
Type
boolean
Path
mod.linkvalidator.checkhidden
Default
0

If set, disabled pages and content elements are checked for broken links, too.

showCheckLinkTab

showCheckLinkTab
Type
boolean
Path
mod.linkvalidator.showCheckLinkTab
Default
1

If set, the backend module shows a "Check Links" tab, which you can use to perform the checks on demand.

The Check links tab is visible

The Check links tab is visible

actionAfterEditRecord

actionAfterEditRecord
Type
string
Path
mod.linkvalidator.actionAfterEditRecord
Default
recheck
Possible values
recheck | setNeedsRecheck

After a record is edited, the list of broken links may no longer be correct, because broken links were changed or removed or new broken links added. Due to this, the list of broken links should be updated.

Possible values are:

recheck
The field is rechecked. (Warning: an RTE field may contain a number of links, rechecking may lead to delays.)
setNeedsRecheck
The entries in the list are marked as needing a recheck

mail.fromname

mail.fromname
Type
string
Path
mod.linkvalidator.mail.fromname
Default
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromName']

Set the from name of the report mail sent by the cron script.

mail.fromemail

mail.fromemail
Type
string
Path
mod.linkvalidator.mail.fromemail
Default
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress']

Set the from email of the report mail sent by the cron script.

mail.replytoname

mail.replytoname
Type
string
Path
mod.linkvalidator.mail.replytoname

Set the replyto name of the report mail sent by the cron script.

mail.replytoemail

mail.replytoemail
Type
string
Path
mod.linkvalidator.mail.replytoemail

Set the replyto email of the report mail sent by the cron script.

mail.subject

mail.subject
Type
string
Path
mod.linkvalidator.mail.subject
Default
TYPO3 LinkValidator report

Set the subject of the report mail sent by the cron script.

linktypesConfig

linktypesConfig
Type
array
Path
mod.linkvalidator.linktypesConfig

All settings within this key are advanced settings. In most cases, the defaults should be sufficient.

external.headers

external.headers
Type
array
Path
mod.linkvalidator.linktypesConfig.external.headers
Default
(empty array)

Additional set of HTTP headers to be passed when crawling URLs.

external.method

external.method
Type
string
Path
mod.linkvalidator.linktypesConfig.external.method
Default
HEAD

This specified which method is used for crawling URLs. By default, we use HEAD (which falls back to GET if HEAD fails).

You can use GET as an alternative, but keep in mind that HEAD is a lightweight request and should be preferred while GET will fetch the remote web page (within the limits specified by range, see next option).

"The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response." (w3 RFC2616).

external.range

external.range
Type
string
Path
mod.linkvalidator.linktypesConfig.external.range
Default
0-4048

Additional HTTP request header 'Range' to be passed when crawling URLs. Use a string to specify the range (in bytes).

external.allowRedirects

external.allowRedirects
Type
boolean
Path
mod.linkvalidator.linktypesConfig.external.allowRedirects
Default
0

New in version 14.0

If enabled, HTTP redirects with external links are reported as problems.

external.timeout

external.timeout
Type
integer
Path
mod.linkvalidator.linktypesConfig.external.timeout
Default
20

HTTP request option. This is the total timeout of the request in seconds.

If set, this overrides the timeout in $GLOBALS['TYPO3_CONF_VARS']['HTTP']['timeout'] which defaults to 0.

Linkvalidator configuration example

config/sites/my-site/page.tsconfig
mod.linkvalidator {
  searchFields {
    pages = url,canonical_link
    tt_content = bodytext,header_link,records
  }
  linktypes = db,file,external
  checkhidden = 0
  mail {
    fromname = TYPO3 LinkValidator
    fromemail = no_reply@mydomain.com
    replytoname =
    replytoemail =
    subject = TYPO3 LinkValidator report
  }
  external {
    httpAgentUrl = https://example.com/info.html
    httpAgentEmail = info@example.com
  }
}
Copied!