Configuration of the Linkvalidator extension
You can find the standard configuration in
EXT:
.
This may serve as an example on how to configure the extension for your needs.
Note
When checking for broken links in the TYPO3 backend module or the corresponding Scheduler task, the page TSconfig of the selected start page is also applied to all subpages - when checking recursive. In case subpages should behave differently and therefore contain a different LinkHandler configuration, they must be checked individually.
Table of contents
Minimal configuration
It is recommended to at least fill out http
and http
.
The latter is only required if $GLOBALS
is not set.
TSconfig Reference
You can set the following options in the TSconifg of a site, for example in
file config/
or in the global page TSconfig
file packages/
of your site
package.
You must prefix them with mod.
, for example
mod.
.
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
search
.Fields LinkValidator ships with sensible defaults that work well for the TYPO3 core, but additional third party extensions are not considered.
Warning
Currently, LinkValidator will only detect links for fields if the TCA configuration meets one of these criteria:
For this reason, it is currently not possible to check for
pages.
. This will be fixed in the future.media Examples for working fields:
pages.
(canonical_ link 'type' => 'link'
)pages.
(url 'softref' => 'url'
)sys_
(file_ reference. link 'type' => 'link'
)
Example for not working fields:
pages.
(media 'type' => 'file'
)
config/sites/my-site/page.tsconfig# Only check for "bodytext" in "tt_content": tt_content = bodytext
Copied!Default values: EXT:linkvalidator/Configuration/page.tsconfigpages = media,url tt_content = bodytext,header_link,records
Copied!
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.
Warning
External links can lead to some known issues.
linktypesConfig.external.httpAgentName
-
- Type
- string
- Path
- mod.linkvalidator.linktypesConfig.linktypesConfig.external.httpAgentName
- Default
TYPO3 Link
Validator
Add descriptive name to be used as 'User-Agent' header when crawling external URLs.
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
-
- Type
- string
- Path
- mod.linkvalidator.linktypesConfig.linktypesConfig.external.httpAgentEmail
- Default
$GLOBALS
['TYPO3_ CONF_ VARS'] ['MAIL'] ['default Mail From Address']
Add descriptive email used in 'User-Agent' header when crawling external URLs.
checkhidden
-
- Type
- boolean
- Path
- mod.linkvalidator.checkhidden
- Default
0
If set, disabled pages and content elements are checked for broken links, too.
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
Note
Depending on the number of page levels to check and on the number of links in these pages, this check can take some time and need some resources. For large sites it might therefore be advisable to hide the tab.
Note
LinkValidator uses a database table to store information about the broken links, which it found in your website. If showCheckLinkTab is set to 0, you must use the Scheduler task provided by LinkValidator to update this information.
actionAfterEditRecord
-
- Type
- string
- Path
- mod.linkvalidator.actionAfterEditRecord
- Default
recheck
- Possible values
recheck
|set
Needs Recheck
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
-
- Type
- string
- Path
- mod.linkvalidator.mail.fromname
- Default
$GLOBALS
['TYPO3_ CONF_ VARS'] ['MAIL'] ['default Mail From Name']
Set the from name of the report mail sent by the cron script.
mail.fromemail
-
- Type
- string
- Path
- mod.linkvalidator.mail.fromemail
- Default
$GLOBALS
['TYPO3_ CONF_ VARS'] ['MAIL'] ['default Mail From Address']
Set the from email of the report mail sent by the cron script.
mail.replytoname
-
- Type
- string
- Path
- mod.linkvalidator.mail.replytoname
Set the replyto name of the report mail sent by the cron script.
mail.replytoemail
-
- Type
- string
- Path
- mod.linkvalidator.mail.replytoemail
Set the replyto email of the report mail sent by the cron script.
mail.subject
-
- Type
- string
- Path
- mod.linkvalidator.mail.subject
- Default
TYPO3 Link
Validator report
Set the subject of the report mail sent by the cron script.
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
-
- Type
- array
- Path
- mod.linkvalidator.linktypesConfig.external.headers
- Default
- (empty array)
Additional set of HTTP headers to be passed when crawling URLs.
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
-
- 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
-
- 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
-
- 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
which defaults to 0.['TYPO3_ CONF_ VARS'] ['HTTP'] ['timeout'] Important
A value of 0 means no timeout, which may result in the request not terminating in some edge cases and can also result in Scheduler tasks to run indefinitely. There is an additional
$GLOBALS
which defaults to 10 seconds, but this may not be enough to lead to a request terminating in some edge cases.['TYPO3_ CONF_ VARS'] ['HTTP'] ['connect_ timeout']
Linkvalidator configuration example
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
}
}