news
news copied to clipboard
News articels with type "internal links" creates 404 pages in sitemap.xml created dynamically with tx_seo configuration
Bug Report
Current Behavior I use the news plugin for the output of press articles. All press articles are of type "Internal Link" and link to a PDF document. The problem concerns the generated Sitemap.xml - the links of these news articles all lead to the news detail page, which does not exist because type "internal link" is given.
Expected behavior/output Sitemap.xml News Plugin Links targeting to the internal link fields. In my case the PDF documents.
Environment
- TYPO3 version(s): 11.5.8
- news version: 9.3.1
- Is your TYPO3 installation set up with Composer (Composer Mode): yes
- OS: Debian Linux
Possible Solution To solve the problem, the DetailAction for the "internal link" type should trigger a redirect to the link target that was stored under "internal link" field. In my case to the PDF document. In this way, there would no longer be 404 pages in the Sitemap.xml, but a correct link to the PDF documents.
Example tx_seo config based on my config
plugin.tx_seo {
config {
xmlSitemap {
sitemaps {
news {
provider = TYPO3\CMS\Seo\XmlSitemap\RecordsXmlSitemapDataProvider
config {
table = tx_news_domain_model_news
sortField = sorting
lastModifiedField = tstamp
#additionalWhere = AND (no_index = 0 OR no_follow = 0)
# page id('s) containing news records
pid = 1
url {
# your detail page id
pageId = 2
fieldToParameterMap {
uid = tx_news_pi1[news]
}
additionalGetParameters {
tx_news_pi1.controller = News
tx_news_pi1.action = detail
}
useCacheHash = 1
}
}
}
}
}
}
}
what about skipping those using the additionalWhere
?
This could be a workaround.