Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi domain sitemap #6

Open
MrWeb opened this issue Mar 26, 2021 · 3 comments
Open

Multi domain sitemap #6

MrWeb opened this issue Mar 26, 2021 · 3 comments

Comments

@MrWeb
Copy link

MrWeb commented Mar 26, 2021

We use the same codebase for more than one site and therefore we have more than one domain.

I'd like to extend the package to accept a url argument, and create a sitemap-{url}.xml file.
If the argument is empty the env('APP_URL') is the default url.

I want to know if this is something you can consider me to update or not, so I know what to do.
Tks

@spekulatius
Copy link
Member

Hello @MrWeb

I haven't run Laravel with multiple domains set up. How does the configuration for this work? Wouldn't this lead to all the sitemap files being public on all of these sites at the same time?

Cheers,
Peter

@MrWeb
Copy link
Author

MrWeb commented Mar 30, 2021

Yes, in case you have many domains pointing to the same code in the server, the files will all be in the same folder.
If the same code is deployed on different servers/folders then only one file will be created.

We could go with two options
php artisan sitemap:generate

and

php artisan sitemap:generate my-site.com

The first one creates a sitemap.xml and looks in the env('APP_URL') as it does currently.
The second one looks for that url specified in the command and creates a sitemap-{url}.xml

@spekulatius
Copy link
Member

Okay, sounds good @MrWeb. Do you want to start a draft PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants