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

No .htaccess #711

Closed
dzuelke opened this issue Nov 28, 2017 · 7 comments
Closed

No .htaccess #711

dzuelke opened this issue Nov 28, 2017 · 7 comments

Comments

@dzuelke
Copy link
Contributor

dzuelke commented Nov 28, 2017

There is currently no .htaccess file in place with rewrites that remove index.php, so out of the box, the demo doesn't work beyond the first page. Is that intentional?

@jkufner
Copy link
Contributor

jkufner commented Nov 28, 2017

Commiting .htaccess is a bad practice, because it complicates deploy. However, it would be nice to have example config files for the most used web servers in the documentation.

@piotrgradzinski
Copy link
Contributor

@dzuelke - as per @jkufner comment this is considered as a bad practise.

Check Configuring a Web Server documentation section for an explanation and information on how you should configure your web server.

Nevertheless you can use apache-pack recipe for adding .htaccess to you public folder by executing

composer require apache-pack.

Hope this helps and answers you concern.

@bocharsky-bw
Copy link
Contributor

Actually a good point. As far as we have a "Deploy to Heroku" button in README, we should have a proper .htaccess for it as well to make it working out of the box

@dzuelke
Copy link
Contributor Author

dzuelke commented Dec 5, 2017

Yeah I'm mostly interested in having it work out of the box on as many setups as possible, as it's a demo app. I could easily do a PR with a Heroku specific config or something, but would rather not clutter the repo with a vendor specific thing (the demo right now is not working on Heroku, for other reasons as well, such as SensioDistributionBundle being gone which used to write the Procfile).

@javiereguiluz
Copy link
Member

It's true that we don't care about .htaccess in this demo app because we recommend to use the Symfony server (bin/console server:start command) to browse the app.

However, I agree that this should work out-of-the-box on Heroku (unless that requires us to change our code). We already have an app.json with Heroku config and stuff (https://github.com/symfony/demo/blob/master/app.json). Could we make more changes in that file to fix this issue? Thanks!

@dzuelke
Copy link
Contributor Author

dzuelke commented Dec 24, 2017

For that we'd need a separate Procfile, but I think I'll add support for automatic detection of Symfony to Heroku's PHP support instead. For that I need a definitive answer to symfony/symfony-docs#8766 though.

@javiereguiluz
Copy link
Member

Let's close this in favor of the automatic detection feature on Heroku proposed by David ... and we'll reopen this if that's not possible to implement for any reason.

javiereguiluz added a commit that referenced this issue Jan 22, 2020
This PR was merged into the master branch.

Discussion
----------

Require symfony/apache-pack package

What about to add `symfony/apache-pack` to this project? We have had a few related issues about missing it: #1069, #1005, #711 . Basically, it's a really small package that just adds `.htaccess` file into public/ dir and that's it. It would help Apache users and does not do any harm to others I think, so why not have it out of the box?

Commits
-------

9a2dad5 Require symfony/apache-pack package
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

5 participants