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

robots.txt and icons in /web folder #3

Closed
sadovnik opened this issue Jun 25, 2015 · 4 comments
Closed

robots.txt and icons in /web folder #3

sadovnik opened this issue Jun 25, 2015 · 4 comments

Comments

@sadovnik
Copy link

Hi

Why do the framework stores these resources? They must be stored in the frontend.
By the way there is no point to have this web folder anymore.

@theofidry
Copy link
Contributor

It's still useful since the front controller is in web. Besides if you're shipping an SPA with it, you may as well put all your front-end files in web instead of having two separate repository. If you don't need it it can always delete it :)

@dunglas
Copy link
Member

dunglas commented Jun 25, 2015

Hi,

This is a rest of the the Symfony standard edition.

The web folder is necessary for storing front controllers.
We can discuss about removing robots.txt and favicon.ico (this one must at least be replaced with the API Platform logo) but as crawlers will always request them, your logs will be full of 404 if they aren't present. It's considered best practice to always have those files.

Solution proposed by @theofidry can be useful for prototype and small apps but the recommended way of using API Platform is having separate git repositories (and servers) for the API and the frontend app.

@sadovnik
Copy link
Author

@dunglas 404 logging of these files can be easily prevented by your web server:

location ~* \/(favicon\.ico|robots\.txt) {
    log_not_found off;
    access_log off;
}

They don't make a problem.

What's the purpose of requesting these files in terms of an API? I haven't found any references about this topic, could you please share some?

@theofidry
Copy link
Contributor

@codeskull they both don't have any use for the API. As @dunglas said crawlers will always request them, and even if you can disable logging for these files, it is not done by default. That's way it is considered good practice to keep them, at least for "distributed products". If you have your API installed, there is nothing preventing you to remove them and disable the logging for that.

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

No branches or pull requests

5 participants