FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > FutureQuest Site Owners (All may read - Only Site Owners May Respond) > Server FAQ
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 01-26-1999, 04:33 AM   Postid: 37974
Deb
FutureQuest, Inc.
 
Deb's Avatar

Forum Notability:
0 pts: Even-handed
[Post Feedback]
 
Join Date: Jun 1998
Location: Franktown Colorado
Posts: 6,781
Ready for .htaccess

Many become paranoid just hearing the word .htaccess more less actually thinking about creating an .htaccess file. What's below is an effort to help you lose the fear and get your feet wet

With a text editor, create a file named .htaccess without any extension. Place it in your www directory. Add whatever lines below you like to it to accomplish some simple tasks that have great results

To define your own error pages use:
ErrorDocument 401 /not_authorized.html
(if you have a password protected directory and the visitor does not know the password then they would see your 'not_authorized.html' page rather then the default one.)

ErrorDocument 404 /not_found.shtml
(if you do not want to use 404.html you can change what the file is called)

ErrorDocument 500 /error.html
(ever had a script not work? Tired of seeing "Internal Server Error" change the page with this line)

If the full URL of your site is 'http://www.yourdomain.com', then '/error.html' means its location is 'http://www.yourdomain.com/error.html'. So if you like, you can also use '/subdir/error.html' to define another directory that contains your error documents.

Let's say you have http://your_domain.com/subdir/index.html
And you decide to move all of the files that were in /subdir/ into a new directory called /newdir/

This normally would cause all of your visitors to get a "404 File Not Found" error. BUT -

Place into the old directory a .htacces file that contains:
<Limit GET POST>
deny from all
ErrorDocument 403 /newdir/index.html </Limit>


This will redirect all visitors directly to your new directory, even the search engines

See... .htaccess files are great!


------------------
Unlocking the Power of the Internet!
www.FutureQuest.net

[This message has been edited by Deb (edited 01-26-99).]
Deb is offline   Reply With Quote
Old 01-26-1999, 05:49 AM   Postid: 37975
Justin
Registered User
 
Justin's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Jan 1999
Location: Kissimmee, FL
Posts: 3,672
I would just like to add that in Windows I cannot create or name a file preceded with a dot. It thinks of that as the extention and asks for a filename.

Windows absolutely refuses to let you name a file without a name before the dot.

I just call it htaccess and rename it after uploading it. Some FTP clients also have an auto rename scheme (Cute FTP does), where you can specify that any file named htaccess will become .htaccess and you can also have it do the reverse for downloading and editing it.

My borrowed 2 cents

Justin
Justin is offline   Reply With Quote
Old 01-26-1999, 06:29 AM   Postid: 37976
Dean B
Site Owner
 
Dean B's Avatar

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Jan 1999
Location: U.K
Posts: 483
I always create htaccess.txt then do as you Justin and rename the file after it's been uploaded. Any other tricks we can do with .htaccess other than those you've mentioned Deb ? BTW, and completely off subject, what's the keys for the smiley with the shades and what's its gif called ? As I consider FL my second home I feel entitled to use it


------------------
Regards, Dean.
**DMCity Web Board**
http://xdmcity.futurequest.net/cgi-bin/ubb/Ultimate.cgi


Dean B is offline   Reply With Quote
Old 01-26-1999, 09:10 AM   Postid: 37977
hearts
Registered User
 
hearts's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Dec 1998
Location: An isolated town in Georgia
Posts: 901
hey Dean...

if ya go to http://www.futurequest.net/ubb/faq.html that is where the codes are for all the faces. The face with the shades is : D (without the space) and is called biggrin.gif .. BUT ya might wanna check with Deb before using it.. CUZ
Quote:
All material on the AOTA.net domain is �copyright 1998 & 1999.
now gonna see if i can figure out if i can apply what deb wrote! *giggle*
hearts is offline   Reply With Quote
Old 01-26-1999, 09:37 AM   Postid: 37978
hearts
Registered User
 
hearts's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Dec 1998
Location: An isolated town in Georgia
Posts: 901
hey deb!!!

I did it!!!

i love .htaccess .. a lot less intimidating than i thought! Thanks for the learning!



----

~ hearts
hearts is offline   Reply With Quote
Old 01-26-1999, 11:56 AM   Postid: 37979
Deb
FutureQuest, Inc.
 
Deb's Avatar

Forum Notability:
0 pts: Even-handed
[Post Feedback]
 
Join Date: Jun 1998
Location: Franktown Colorado
Posts: 6,781
hehe the shades are free game
And I'm glad to hear you did it hearts -- That was the goal was to encourage those who haven't "taken the step" to do so

Good point on the windows file name issues... I forgot to mention that. I simply upload as save as not.htaccess and rename as it's uploading....

NOTE: UPLOAD IN ASCII that would probably be the only other main mishap....

Deb

[This message has been edited by Deb (edited 01-26-99).]
Deb is offline   Reply With Quote
Old 01-26-1999, 02:07 PM   Postid: 37980
Del
Registered User

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Nov 1998
Location: San Bernardino, CA, USA
Posts: 367
I think it depends on what editor you use on a PC when you create your .htaccess file. I use Arachnophilia for almost everything, and it allows me to name stuff whatever I want, including .htaccess. Notepad will always name it htaccess.txt, losing the preceding dot and forcing a rename after upload. Well, that's what happens on my end anyway.

Del

Oh yeah, the freakin phone is still out at home. GTE guy is coming again today, hopefully while it's still out. Says he can't find anything cause everytime he shows up it's working again... ggrrrrr
Del is offline   Reply With Quote
Old 01-26-1999, 10:03 PM   Postid: 37981
Rich
Merchant Rep
 
Rich's Avatar

Forum Notability:
153 pts: Ambassador of Goodwill
[Post Feedback]
 
Join Date: Nov 1998
Location: Indiana, USA
Posts: 1,658
A few additional comments for those creating .htaccess (or .any other type of file with an extionsion only) on a PC:

Regardless of what Microsoft would have you believe otherwise, Windows is still just a graphical operating system (or window) into the older (and newer) DOS file structure. This underlying DOS file structure considers file names such as .foo as valid. If you are comfortable using the MS DOS Prompt command-line environment, you may create files named with only an extension and also use EDIT to edit and save them.

Inside the more familiar Windows interface, each application determines whether these types of file names are valid. Even the Windows Explorer is just an application and it does NOT allow this naming structure.

Only if an application developer spends extra effort, time, money, etc. will the Open/Save dialogs allow this type of file name.

Thus, at times you will see a .foo type of file (some application that allowed it created it) and then later see it mysteriously change into a filename.ext format or you are prompted and only allowed to save it in this format when the current application will not allow it.

Unfortunately, knowing why this happens doesn't help overcome the problem. As stated previously in other posts, it is a good rule of thumb to double check the name of the file on the server after changing/uploading .htaccess or a similarly named file.

------------------
Rich

"What time is it in _____?"
www.timezoneconverter.com

Rich is offline   Reply With Quote
Old 02-02-1999, 12:54 AM   Postid: 37982
Benson
Registered User

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Dec 1998
Location: NC, USA
Posts: 478
Can .htaccess files be simply used to prevent directory browsing? I don't need pw protection at all for this. Everything I've tried does not work plus I've been careful re ascii upload, etc.
Benson is offline   Reply With Quote
Old 02-02-1999, 01:11 AM   Postid: 37983
Jacob Stetser
Registered User

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Dec 1998
Location: Decatur, GA 30032
Posts: 447
Benson,

Inside your www folder (or whatever folder you want people not to browse), put this in your .htaccess file

Options -Indexes

and make sure you hit enter to add a line feed after that, or it won't work. But that's the line that will turn off directory indexing, ala directory browsing, and it will cascade down through directories below, so you only have to do it once if you do it in your www directory.

Hope that helps, I got it from ccTech, but then again, I might be delusional and be saying the absolute wrong thing.

I like the sense of community here at FQ. It's really a refreshing thing at an IPP.

Toodles!
Jacob Stetser is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 12:24 AM.


Running on vBulletin®
Copyright © 2000 - 2019, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2019 FutureQuest, Inc.
FutureQuest, Inc.