owj8sw
Last Updated: February 25, 2016
·
11.02K
· rstacruz

Host a static HTML/CSS site in Heroku

touch index.php

Yes, that's all it takes. It tells Heroku that the site is a PHP site and that it will be hosted using Apache.

And yes, you can still have an index.html file. The .html file takes precedence over the .php one.

6 Responses
Add your response

1783

My god. This is just superb.

over 1 year ago ·
2070

Nice! Thank you

over 1 year ago ·
2738

I think this will work if you add any character to that file. Last time I tried it didn't let me create the site.

over 1 year ago ·
3961

I never tried heroku, even though I heard of it. This makes a little more sense now, makes me want to go try it out for myself :)

over 1 year ago ·
3997

@rstacruz: Thank you. I use Heroku for a while, and always use Flask or Sinatra for tiny websites.

I would like to add a note, that you can use HTML on Heroku to send emails, or register users, through REST API's.

Examples:
1. Sendgrid - http://sendgrid.com/docs/API_Reference/Web_API/mail.html
2. MongoLab - https://support.mongolab.com/entries/20433053-rest-api-documentation

Disclaimer: I do not affiliate with any of these companies.

over 1 year ago ·
11275

Sorry, noob here. Where do I put touch index.php? In my index.html file?

over 1 year ago ·