I'm on a Windows 10 environment with WAMP installed and I had exactly the same problem. Front End failed. Back End worked fine. News links failed. Clicking on website name link from the Localhost screen reveals directory contents. No matter how many times I kept clean installing Craft and tweaking and adding .htaccess files, the problem remained.
I solved the problem in the following way, without the need to add any .htaccess files. It's best to do a complete clean install of Craft.
You'll need the original, untouched, craft and public folders. Apologies if these following points go over what you already know.
- Copy the craft and public folders into the wamp/www/sitename folder as normal (or the Mac equivalent)
- Remove all the files from the public folder and place them at the base level (i.e. same level as the craft folder)
- Delete the public folder.
- Rename the root htaccess file to .htaccess
Open up the .htaccess file and add this line
RewriteBase /
after this line
RewriteEngine On
In the root index.php file change line 4 to $craftPath = './craft';
- Create your localhost database.
- Set up your database connection details within craft/config/db.php.
- Via your browser, enter localhost/sitename/index.php/admin/install
- Click on the Begin button.
- Create your account page, fill out as normal.
- When you get to the Setup your site page, complete the Site URL details like this:
http://localhost/sitename
Finish off the install as normal and when your dashboard gets displayed, click on the Website name (top left) to go to the Front End and it will work. Click on the News link and it will work. As will Live Preview. Go to the Localhost page, click on the website name and you will go to your home page instead of having directory details displayed. Finally, if you upload this whole website to your live site it will still work.
Hope this helps someone.
As a slight caveat, I have only been testing Craft for a couple of days and installing it is about as far as I have got to at the moment. So if I've broken Craft no-no's like 'never delete the public folder, then I apologise (obviously, it doesn't have to be deleted and just remain empty)