Showing Hidden .htaccess Files

Discussion in 'macOS' started by tacoX, Jan 10, 2007.

  1. tacoX macrumors newbie

    Joined:
    Nov 9, 2006
    #1
    I'm a web master that needs to use .htaccess files often with my websites. When I converted to a mac, it seems like the operating system just hid all the .htaccess files. I don't want to unhide ALL files, how bout just .htaccess ones?

    Thanks,
     
  2. Arcus macrumors 6502a

    Joined:
    Dec 28, 2004
    Location:
    of my hand will get me slapped.
    #2
    How about ls -a ?

    With a website that claims what yours claims you should know this. Odd indeed..
     
  3. Arcus macrumors 6502a

    Joined:
    Dec 28, 2004
    Location:
    of my hand will get me slapped.
    #3
    "! Getting used to Macromedia Dreamweaver is difficult, because I have used Microsoft Frontpage for years. This goal that i've set for myself really forced me to learn more about Dreamweaver, and get really used to it."

    No offense, but this explains it. Get out of WYSIWYG and get into command line. Your gonna need it.
     
  4. darthmole12 macrumors newbie

    Joined:
    Jan 10, 2007
    #4
    I'll be a little nicer than the others, since you're a newbie :p.

    Okay, so the reason you are seeing this is because on UNIX systems, hidden files are signified by a period in front of the file name. This is different from Windows, where hidden one of the attribute flags on a file. (Now for full disclosure, I'm pretty sure that the Mac HFS+ file system has another method to hide files without the leading period).

    So it's not that OS X is "hiding" the files per se, it's just that .htaccess files ARE MEANT to be hidden files.

    So in order to edit .htaccess files on your Mac, you have two (maybe 3) options:

    1.) Make the Finder display all hidden files. While this isn't your preferred solution, it will end up being more user-friendly since then you can open it up with TextEdit or whatever text editor you want to use. This isn't as easy as it could be, but it's still very simple: http://www.osxfaq.com/DailyTips/02-2005/02-01.ws

    2.) Your other option is to fire up Terminal, use UNIX commands to get to the directory where your .htaccess file is, and then you can edit it with nano, emacs, or vim (I would recommend nano for beginner users since it's much easier to use initially). Unfortunately, this requires you to be somewhat comfortable using command-line UNIX commands, so it may not be the best solution for you.

    3.) It's possible that some text editors which use their own file>open dialog box as opposed to the cocoa one will be able to show the hidden files. I don't know of any off the top of my head though, so you'd have to do a little bit of research.
     
  5. Arcus macrumors 6502a

    Joined:
    Dec 28, 2004
    Location:
    of my hand will get me slapped.
    #5
    Honestly, with all the claims on his site...

    ASP
    PERL
    SERVER MANAGEMENT
    PHP
    AJAX

    and he doesnt know ls -a ? Come on now!?! Read his about page and ask yourself how someone can claim to be all of that and NOT know some basic , like OMG basic commands.

    Im not trying to be a jerk , but people claiming to be all of these things should really actaully be a bit knowledgable. Ive seen way to many fly by night companies rip people off claiming to be the 'end all be all' of web site development and not know a dam thing really. This appears to be a possible candidate.

    *put on flame suit*
     
  6. tacoX thread starter macrumors newbie

    Joined:
    Nov 9, 2006
    #6
    All the jobs you mentioned are outsourced, overpriced, and cut the difference to make a profit. My personal job is website development

    I own well over 85 websites all done with WYSWYG editors... its the quickest way. Its kinda funny how newbies like me pay smart people (you?) salary to make web applications.

    Dunno... its hard getting used to my new Mac Pro 64-Bit Quad Core 2.6 2gigs ram computers new operating system, give me a break brotha. And i'm referring to viewing the .htaccess files on my macosx. Can you cut the flames and help a newbie out.
     
  7. Huntn macrumors G4

    Huntn

    Joined:
    May 5, 2008
    Location:
    The Misty Mountains
    #7
    I am a newb, who has been managing a basic web site in Dreamweaver for many years for my local Mac user group. :) We are turning over the web site to iWeb so that it is simple for people who know even less than me. :)

    Our site is hosted on a mac server. In converting the site to iWeb, I've noticed if the main page is listed as "Home.html", the site will not display it when a search is done for www.miniapples.org. But if I change the main page to "Default.html" then it appears. However in iWeb whatever you name the page is what appears on the site. I don't want this page called "Default" but "Home".

    I've seen the discussion on invisible .(dot) files. I'm using Fetch to upload the site to our server. I assume Fetch will be able to find this invisible file and upload it?

    So I'm going to try to use htaccess to set the default page as "home". Is this the way to do it on a Mac? Unless I hear otherwise I'm going to create a text document called .htaccess and type into it: DirectoryIndex home.html and then upload it to my site.

    Sound good?
    Thanks!
     
  8. Huntn macrumors G4

    Huntn

    Joined:
    May 5, 2008
    Location:
    The Misty Mountains
    #8
    I talked to the server host today and they say they can simply change a server setting so "home.html" will be recognized as the default page...
     
  9. belvdr macrumors 601

    Joined:
    Aug 15, 2005
    #9
    Then use Terminal and do a 'cat .htaccess' to see the file.
     
  10. JohnMacArts macrumors newbie

    Joined:
    Oct 7, 2011
    #10
    far easier solution

    Create your .htaccess files using Text Wrangler - it's free, download it... To open them again, go to File:Open Hidden in the text wrangler program. It can read hidden files. What I would suggest is initially creating the files as A.htaccess then dropping the A once you're done. Far easier than using UNIX or any other of the options (unless i missed something - I read the thread kinda quick)

    Oh and please please please stop using WYSIWYG programs to build your site. It may be faster to build the first time but when I have to edit the garbage that's generated by some of these programs it really ends up costing the client far more than it's worth. Build your content and use Dreamweaver as an advanced text editor or use Text Wrangler. Style your sheets properly with clean external style sheets and indent your code so it is easy for a noob like me to read it. Maybe leave a few notes now and then too. :p

    Remember other people will eventually get hired to change the site you build, add content etc... If your site can't be easily edited it will cost your client money, and if it's me doing the work, it will make my teeth itch. I'll certainly look into who created the site and I'll certainly make sure I remember the name.

    --best:
    cool:
     
  11. r0k macrumors 68040

    r0k

    Joined:
    Mar 3, 2008
    Location:
    Detroit
    #11
    Psssst...

    Um, John?

    You answered a question that hasn't seen a response in two years. Chances are this guy either moved on, is teaching Unix sysadmin classes, or is flipping burgers by now. :eek:

    Nice thought, though. I use textwrangler. I also use vi in terminal. I used iWeb briefly but had to let it go when I found out the iWeb and .mac not only couldn't speak php but couldn't speak even the simplest kind of server side scripting. I like the shortcuts wysiwyg editors allow but I really like the shortcuts scripting allows like including files across an entire site or being able to change the look of a 500+ page site by editing only one file.

    BTW, the new site is much better looking than the old one. The site uses a refresh tag but if you're quick, you can click one of the old links and see what it looked like before it started looking all modern.
     
  12. kensnyder macrumors newbie

    Joined:
    Oct 28, 2011
    #12
    Nice try but you are being a JERK. This whole thread is ugly. The problem that the original poster put there was a reasonable question even if it's basic for some of you. Life may be nasty, brutish and short but at least we can be civil to one another when we post.

    Anyway, I see that this post is pretty old even though I think people are still having this problem. I'm new to the Mac and I was having it. Anyway I've come up with a very short shell script that will do the trick:

    PHP:
    #!/bin/sh 
    # forces Finder to show hidden/system files

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

    I've attached this to as an Alfred Shell Extension so I can quickly switch between hidden and not hidden. Hope this helps.
     
  13. ScooterPT macrumors newbie

    ScooterPT

    Joined:
    Apr 4, 2011
    Location:
    Lisbon Portugal
    #13
    Use textwrangler file-> show hidden files. You should be able to see and edit the file
     

Share This Page