Comments (8)
@mente suggests to add a host option to dumper command in #16 .
The filesystem generation (I mean the dumper command) is currently not compatible with multiple hosts since each host needs its own sitemap.
What is the size of your sitemap ? May be the dynamic sitemap generation + cache will feet your needs.
from prestasitemapbundle.
Problem not in sitemap size, just our SEO-man needed different sitemaps for different subdomains).
Dynamic sitemap generation is very interesting, but we need to know in generator listener what subdonain used.
from prestasitemapbundle.
You can dynamically inject request instance to your listener and check for host. Starting from 2.3.0 Symfony you can use synchronized parameter and request will be dynamically updated depending on current scope. Consider reading scopes doc
from prestasitemapbundle.
This works, but we have small problem with code.
There are:
- main site main.com
- other site with subdomains other.com, ololo.other.com
So I've created routes:
# -------------------- sitemap start
SprosPrestaSitemapBundle:Sitemap:index:
pattern: /sitemap.{_format}
defaults: { _controller: PrestaSitemapBundle:Sitemap:index, sitemap: metallspros }
host: "%base_host_other%"
requirements:
_format: xml
SprosPrestaSitemapBundle:Sitemap:section:
pattern: /sitemap.{name}.{_format}
defaults: { _controller: PrestaSitemapBundle:Sitemap:section, sitemap: metallspros }
host: "%base_host_other%"
requirements:
_format: xml
SprosPrestaSitemapBundle:Sitemap:index_subdomain:
pattern: /sitemap.{_format}
defaults: { _controller: PrestaSitemapBundle:Sitemap:index, sitemap: metallspros }
host: "{subdomain}.%base_host_other%"
requirements:
_format: xml
SprosPrestaSitemapBundle:Sitemap:section_subdomain:
pattern: /sitemap.{name}.{_format}
defaults: { _controller: PrestaSitemapBundle:Sitemap:section, sitemap: metallspros }
host: "{subdomain}.%base_host_other%"
requirements:
_format: xml
PrestaSitemapBundle_section:
pattern: /sitemap.{name}.{_format}
defaults: { _controller: PrestaSitemapBundle:Sitemap:section }
requirements:
_format: xml
# -------------------- sitemap end
as you see - I've added new attribute - metallspros. It needed for detecting in listener, what concrete sitemap to generate (we shouldn't generate sitemap for other.com when opening main.com/sitemap.xml).
How it possible do it more clear?
from prestasitemapbundle.
Also we cann't use cache because cache key depends only on section name. But we should depends on hostname too
from prestasitemapbundle.
8 month and nothing so what is the plan ?
Continue / close ?
from prestasitemapbundle.
@Koc do you want me to work on this ?
from prestasitemapbundle.
Closing due to a lack of activity.
Please feel free to reopen if you want to work on this.
from prestasitemapbundle.
Related Issues (20)
- Repository service id ? HOT 1
- How to include translated routes in dump file ? HOT 2
- Cancel <lastmod> field HOT 1
- Multi-domain errors cause sitemapindex XML confusion
- Creation of sitemap.xml files in sub directory HOT 4
- Deprecation Warning as of Symfony 6.2 HOT 3
- Wrong Domain in Index Sitemap if multiple Tenants are in use HOT 4
- Decorating in AddUrlEvent is impossible HOT 2
- S3 compliant HOT 2
- Fill field lastmod on a per url basis ? HOT 2
- Help: No URLs were added to sitemap by EventListeners - this may happen when provided section is invalid HOT 2
- Urlset->add() doesn't use Url->lastmod() for the Urlset lastmod HOT 3
- Drop Symfony 4.4, add Symfony 7 HOT 4
- Add /robots.txt route HOT 2
- Add (or Document) how to get the section list from the sitemap service HOT 1
- Add option for xsl
- route context not generating as expected HOT 5
- Routes generated twice in the XML HOT 3
- Allow to add custom URLs to sitemap index without populating section HOT 12
- Namespace Issue in Sitemap HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prestasitemapbundle.