tmec
(Tobias M. Eckrich)
January 13, 2020, 10:48am
1
I would like to output a Google News Sitemap for my project. Unfortunately I always get a 404 message. Additionally there are contradictory statements in the ./flow routing: *
There is nothing in the error logs.
Here my code:
Routings.yaml
- name: 'GoogleNews'
uriPattern: 'sitemap-news.xml'
defaults:
'@package': 'FooBar'
'@controller': 'GoogleNews'
'@action': 'sitemap'
'@format': 'xml'
Settings.yaml
Neos:
Flow:
mvc:
routes:
F03.DmgDriven:
position: 'start'
./flow routing:list
Currently registered routes:
1. sitemap-news.xml Foo.Bar :: GoogleNews
.....
91. Neos.Flow :: fallback
./flow routing:routepath sitemap-news.xml
Path:
sitemap-news.xml
Route:
Name: Neos.Neos :: Frontend :: Homepage
Pattern: {node}
Result:
Package: Neos.Neos
Subpackage: -
Controller: Frontend\Node
Action: show
Format: html
Controller:
Neos\Neos\Controller\Frontend\NodeController
bwaidelich
(Bastian Waidelich)
January 13, 2020, 12:13pm
2
You seem to have a typo in your route definition (you can tell by the @package
part turning red above).
./flow routing:show 1
will probably reveal the issue:
...
Defaults:
- @package => FooBar'
bwaidelich
(Bastian Waidelich)
January 13, 2020, 12:24pm
3
…also to test your route via CLI you need to prefix a leading slash apparently:
./flow routing:routepath /sitemap-news.xml
tmec
(Tobias M. Eckrich)
January 13, 2020, 12:31pm
4
Thx. The typo watch only a copy past fail. in my routing.yaml it is correct.
the correct call of ./flow routing:routepath /sitemap-news.xml
gives me a other error now.
Path:
/sitemap-news.xml
Route:
Name: Foo.Bar :: GoogleNews
Pattern: sitemap-news.xml
Result:
Package: Foo.Bar
Subpackage: -
Controller: GoogleNews
Action: sitemap
Format: xml
Controller Error:
!!! No Controller Object found !!!
This is where the Controller is:
DistributionPackages/Foo.Bar/Classes/Controller/GoogleNewsController.php and is has the method: sitemapAction
tmec
(Tobias M. Eckrich)
January 13, 2020, 12:47pm
5
I missed this in my composer.json m(
"autoload": {
"psr-4": {
"Foo\\Bar\\": "Classes"
}
}
bwaidelich
(Bastian Waidelich)
January 13, 2020, 4:56pm
6
Great.
Whenever you come across a routing exception make sure to take a look into the System log. There’s usually more information about the error to be found.
Can I mark this issue as resolved?
tmec
(Tobias M. Eckrich)
January 14, 2020, 7:40am
7
Yes, please and Thx for your help.
1 Like