Web developing, Htaccess

Joined
Mar 18, 2011
Messages
19
Reaction score
0
Points
1
Your Mac's Specs
Macbook Pro 2.4Ghz C2D, 4GB DDR3,250GB HD
Hello all, new user here, first post, but obviously not a new user to forums :D.

This question may be dumb but at the same time many people would want to know the answer. Now I know OsX tends to hide files that begins with ".". I'm a web designer beginner web designer and I have a problem. Having switched from winderz, my htaccess file cannot be seen, therefore I cannot click links on my local websites will fail to work.

Is there "any" way that the htaccess can be like given an exclusion, or maybe in xammp, apache can parse the curse thing ?

cheers guys

thanks
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
Moved to proper forum and edited your title for clarity.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
It will still be read by Apache if it's hidden - the fact that you can't see it doesn't mean that Apache cannot. If you need to open it, open up a Terminal (/Applications/Utilities/) and type the following:
Code:
open -a <editor name> <location of file>
So, if I wanted to open up a file on my desktop named ".test.txt" in TextEdit, I would execute the following:
Code:
open -a TextEdit ~/Desktop/.test.txt
 
OP
P
Joined
Mar 18, 2011
Messages
19
Reaction score
0
Points
1
Your Mac's Specs
Macbook Pro 2.4Ghz C2D, 4GB DDR3,250GB HD
It will still be read by Apache if it's hidden - the fact that you can't see it doesn't mean that Apache cannot. If you need to open it, open up a Terminal (/Applications/Utilities/) and type the following:
Code:
open -a <editor name> <location of file>
So, if I wanted to open up a file on my desktop named ".test.txt" in TextEdit, I would execute the following:
Code:
open -a TextEdit ~/Desktop/.test.txt

Thanks man will try that.

cheers
 
OP
P
Joined
Mar 18, 2011
Messages
19
Reaction score
0
Points
1
Your Mac's Specs
Macbook Pro 2.4Ghz C2D, 4GB DDR3,250GB HD
Vansmith, tried the fix, that works, i mean the editing, but oddly enough, I get the following

qfToK.jpg


with a link on the local site, i have defined in the htaccess that link.html --> link.

The module is loaded though
uGebN.jpg
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Have you restarted Apache? None of the settings in the htaccess file will take effect until you restart Apache. Execute the following:
Code:
sudo /usr/sbin/apachectl restart

As noted by their philosophy:
MAMP was created primarily as a PHP development environment for Macintosh computer and should therefore not be used as Live Webserver for the Internet.
If you're only learning web development and you don't have any intention of actually "going live" (making the pages accessible over the internet), you might want to look into MAMP. You might feel comfortable with that, especially if you're new.
 
Joined
Apr 23, 2009
Messages
79
Reaction score
0
Points
6
Are you positive that you .htaccess syntax is correct?

Maybe we should look at that, too?
 
OP
P
Joined
Mar 18, 2011
Messages
19
Reaction score
0
Points
1
Your Mac's Specs
Macbook Pro 2.4Ghz C2D, 4GB DDR3,250GB HD
Have you restarted Apache? None of the settings in the htaccess file will take effect until you restart Apache. Execute the following:
Code:
sudo /usr/sbin/apachectl restart

As noted by their philosophy:If you're only learning web development and you don't have any intention of actually "going live" (making the pages accessible over the internet), you might want to look into MAMP. You might feel comfortable with that, especially if you're new.
I did actually, via the Xampp controls not via terminal. I even restarted the laptop. The file is local for development, but will go live when done.

Are you positive that you .htaccess syntax is correct?

Maybe we should look at that, too?

The syntax in the htaccess file is
RewriteRule ^about$ about.html
This is only a sample but works on windows
 
OP
P
Joined
Mar 18, 2011
Messages
19
Reaction score
0
Points
1
Your Mac's Specs
Macbook Pro 2.4Ghz C2D, 4GB DDR3,250GB HD
Did you enable htaccess in the httpd.conf? (i.e., allowoverride)
Not just mod_rewrite.

Apache Core Features

I prefer to dev with MAMP.

hey kpmedia, I sorted out the issue, that was because i wasn't working in the xampp htdocs directory. I was actually working in the "sites" folder located in my home directory. It works now. I guess sometimes being stupid is fun !! lol
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top