Where's .htaccess?

Finally was able to get Bedrock + Roots going in a Vagrant VM with Ubuntu 12.04. Anyhow. Now I have some trouble with pretty permalinks. Upon saving the permalink structure I get:

If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.

I doing “touch .htaccess” in the bedrock folder and in web, but with no luck.
Where should it be?

The touch command creates an empty file, but it doesn’t make that file writeable. You need chmod to set up your permissions correctly.

Ah, alright. But still, what should be the location? Straight in Bedrock?

If you have an older version, it goes straight into the root folder. If you have a newer version of Bedrock that has a “web” folder, it would go in there. Basically, put it in the root folder that your website in in, or that your virtual host is pointing to.

Sorry, must’ve gotten wrong permissions for the file in web.

Now it’s there and it gets updated when permalinks are changed, but I still 404 when trying to access posts or pages.

.htaccess looks like

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Seems right, no?

Do you have Apache set up to properly use .htaccess? See this post: Another Permalink Issue

AllowOverride was set to “none”, changed it to All.
Also needed to run sudo a2enmod rewrite

Thanks alot and sorry to bring another thread on the subject!

This topic was automatically closed after 24 hours. New replies are no longer allowed.