Jump to content

Can't rename htaccess.txt in OS X


Recommended Posts

I am a newbie installing for the first time.  

I am on a Mac and get  /.htaccess doesn't exist. Before continuing, you should rename the included htaccess.txt file to be .htaccess (with the period in front of it, and no '.txt' at the end)., but I cannot start a filename in OS X with a period - at least that is what the OS tells me in a message.  What do I do?  Is there some trick or workaround I can use?  I can't be the only one to have faced this problem.

Thanks all!


Link to comment
Share on other sites

By default Mac doesn't let you view "hidden" files which start with a period.

You can change this setting in the terminal:

defaults write com.apple.finder AppleShowAllFiles -bool YES
killall Finder

Then Finder should let you rename.

Otherwise you can just rename directly in the terminal:

cd /pathto_htaccess.txt/
mv htaccess.txt .htaccess

Of course you could do it from anywhere without cd 'ing into the directory, but thought this might be easier to understand as I am not sure your experience level with terminal commands.

  • Like 1
Link to comment
Share on other sites

Hah. Someone was faster.

Tip for the terminal: To get to that directory you can enter "cd " (cd with a space) and then drag the folder where the htaccess.txt is located into the terminal window. Hit enter. Then the terminal switched to that directory.
Then you can use the "mv" command adrian posted above.

  • Like 1
Link to comment
Share on other sites

4 hours ago, dweeda said:

I knew there must be a way!  - D

Welcome to the forum :)

Another option (among others): http://trolsoft.ru/en/soft/trolcommander

Free, and you can turn invisible stuff on/off.

Or a Finder "extension": https://www.trankynam.com/xtrafinder/

Note that XtraFinder is a bit buggy (and/or Apple's Finder is buggy, so it is impossible to add these features properly by 3rd parties, which is quite possible... Finder has always been buggy too) Also, you need to disable System Integrity to make it work on 10.11 and above:  https://www.trankynam.com/xtrafinder/sip.html

I've been using XtraFinder for a long time, it is a great timesaver.

  • Like 2
Link to comment
Share on other sites

Awesome tips that solves your dot filename issues,  I want to throw in an other approach so you won't have that issue that often. When you change the user that runs apache, the ProcessWire install wil handle the renaming of the htaccess among other things. I only recommend this when you are the only user on your mac that uses the internal apache.

Changing the user is quite simple:

Go to /etc/apache2/httpd.conf, find the block that looks like the block below, and change the user and the group to your short username and the group. In the example I already did that with my name.

After changing that name, restart apache and apache will run with You as user. this will solve a lot of user right issues.


<IfModule unixd_module>
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
# User _www
# Group _www

User martijn
Group staff



  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...