Details
-
Improvement
-
Resolution: Won't Do
-
Major
-
None
-
4.0
-
None
-
None
Description
Currently one page can be accessed in multiple different ways, i.e.:
- http://www.magnolia.info/en/products/enterprise
- http://www.magnolia.info/en/products/enterprise/
- http://www.magnolia.info/en/products/enterprise.html
For SEO it would be better if first two cases are re-mapped to the third.
The second case can be mapped using VirtualURIMapping
class=i.m.cms.beans.config.RegexpVirtualURIMapping fromURI=/(.*)/$ toURI=redirect:/#1.html
Solving the first case using VirtualURIMapping would require mapper intelligent enough to parse the url, figure out if there are any query params. Something along lines of
class=i.m.cms.beans.config.RegexpVirtualURIMapping
fromURI=/(.*[^'.html'])(\\?)(.*)
toURI=redirect:/$1.html$2$3
and for requests without any query params:
class=i.m.cms.beans.config.RegexpVirtualURIMapping fromURI=/([^\\?]*)$ toURI=redirect:/$1.html
Or possibly combination of the two patterns above into one covering both cases - w/ and w/o query params.
However since default extension can be configured in admin interface, this mapping should be smart enough to use the default extension rather then blindly mapping everything to html.
Checklists
Attachments
Issue Links
- is related to
-
MAGNOLIA-1529 URLs with trailing slash result in broken links
-
- Closed
-