Symfony 2 - hide the whole website with a HTTP Authentication dialog

后端 未结 2 1097
清歌不尽
清歌不尽 2021-01-19 02:46

I am using Symfony 2 for building a website.

The work is in progress (therefore I don\'t want users or search engines to access it) but my client wants to see my pro

2条回答
  •  时光取名叫无心
    2021-01-19 03:23

    On my opinion, what you need is not to manage users with HTTP authentication but to restrict access to your site with HTTP authentication. Don't use Symfony2 security for that.

    Leave your symfony2 app security as it will be in production mode and use apache .htaccess to restrict access to the site.

    Documentation is here http://httpd.apache.org/docs/2.2/howto/auth.html. You just have to add some directives in web/.htaccess, and create a user/password file as explained in the doc...

提交回复
热议问题