dweeda

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!

David

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

</IfModule>

 

  • Like 4

Share this post


Link to post
Share on other sites

I completely agree with @Martijn Geerts - that's a much better approach, but I also think that as a developer it is important to be able to see hidden files, so I would still go with the terminal command to make these visible.

  • Like 1

Share this post


Link to post
Share on other sites

also, consider buying PathFinder on your mac, you will have full control over your file system and will save you a lot of time. I am on a mac since september, and didnt opened the Finder since I tried this program.

  • Like 2

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Jennifer Stock
      Greetings. I would like to restrict access to certain sections of my organization's ProcessWire site using pubcookie. We are rolling out Shibboleth authentication later this year but for now, it seems I can only make use of our institution's single sign-on routine by utilizing rules in an .htaccess file. 
      I am wondering if there is a way to ask PW to apply these rules to certain pages in the site, whether via template type or location in the page tree:
      AuthType UWNetID PubcookieAppID "MyApplication" require type staff faculty  
    • By dweeda
      I installed an SSL Certificate, then edited my .htaccess file:
        # -----------------------------------------------------------------------------------------------
        # 9. If you only want to allow HTTPS, uncomment the RewriteCond and RewriteRule lines below.
        # -----------------------------------------------------------------------------------------------
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
      by uncommenting out the Rewrite lines.
      Now I get 404 error pages when I try go to any .../processwire-master/<pagename>/
      This includes my admin page at .../processwire-master/processwire/, so i can't get into my admin.
      What else do I need to do?
    • By pwfans
      Hello,
      1. Anybody can help, why this htaccess (location in root) doesn't work at 3.0.98 ? it show 404
      RewriteEngine on RewriteRule ^(.*)$ /subdirectory/$1 [L] That rule works in 3.0.62
      It redirect root request to subdirectory processwire installation and hiding the subdirectory name in url.
      I have try to uncomment htaccess inside subdirectory processwire installation :
      RewriteBase /pw/ to RewriteBase /subdirectory/ Doesn't help, still 404 when open the site from root domain.
      2. Is there anyway to find processwire version from processwire files ? not from admin login page.
      Thank you.
    • By rareyush
      I moved my site to Google cloud platform and i am stuck some where.
      my homepage is working fine but when it comes to other pages it says 404 not found
      and when i add this on virtual host 
       
      <Directory "/var/www"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> or <Directory "/var/www"> AllowOverride All </Directory>  
          I receive internal server error 
       
       
       
      I tried comment out this line to but still same thing 
      # RewriteBase /
      and
        # RewriteRule ^(.*)$ /index.php?it=$1 [L,QSA]
    • By joelplambeck
      Hi Guys,
      I'm trying to do my first migration to the customers existing server (IIS 10) . I ran the site as a subdirectory on my website for test purposes (everything works fine).
      Following the tutorial of Joss, I tryed the site on a local xampp server to make sure, it also works on a root directory. So far so good, everything works.
      Now I moved the files (from the xampp) to the customers server. The root/index page is shown but for every subpage i get 404 Errors...
      Hence I followed the troubleshooting guide for not working URLs:
      On the first sight, the .htaccess file is not recognized, therefore I contacted the host support. They said, it is recognized but not all modules are supported in the processwire .htaccess file. I did the "öalskjfdoal" test in the .htaccess file and didn't get a 500 Error.... BUT the rewrite rule from the hosts support, to proof the file is read, DID work... The support claims, they do not provide debugging... so basically the .htaccess file is recognized and working, but not throwing any errors (for whatever reason).
      Working rewrite rule (from support):
      RewriteEngine On RewriteBase / RewriteRule ^test\.asp$ index.html [NC,L] RewriteRule ^test\.html$ konzept.html [NC,L] RewriteRule ^test2\.html$ team.html [NC,L] The support said, a couple modules are not supported in the htaccess file, the supported ones are listed here: http://www.helicontech.com/ape/ (I think mod_rewrite is supported)
      As I do not completely understand what exactly is happening in the htaccess file, I'm stuck. I tried all suggestions I found regarding this topic on the forum, but none of them solved the problem.
       
      .htaccess.txt