Jump to content

What Is .htaccess?


karlfranz

Recommended Posts

.htaccess is just about the proverbial god of webservers. It can control password protection, error documents, redirects, and lots of other things. Here is a tutorial for beginners that may help you out.

 

Note: Always make a backup. .htaccess can easily cause complete loss of access to your site, on purpose or by mistake, so be very, very careful and *always, always test* to make sure your site is properly performing after a change. Even if the modificatin seems minor. =)

Link to comment
Share on other sites

sorry,I don't inderstand what does "complete loss of access to your site" mean?

If you make a mistake editing your .htaccess file you may not be able to access anything in your domain.

 

That is without opening a support ticket and having one the TCH techs remove the file.

Link to comment
Share on other sites

Thank you,

so do you know what's wrong with my .htaccess file:

when I try to view the .htaccess file using Smartftp,it always reported there's is another ".htaccess" in the same directory and ask me whether I want to resume,overwrite or skip it,however,I'm sure I can only see ONE .htaccess file in that directory.

Is this a bug of Smartftp or an error of my server?

Link to comment
Share on other sites

If you want to view your htaccess file, you have two stable options...

Download the file to your local machine and open it with a text editor (notepad or similar, but NOT Micr$oft Word), or view it through the file manager in your cPanel.

Either way, you should download the file as a backup for safe keeping, and never edit that backup file... just in case.

Link to comment
Share on other sites

Thank you,

so do you know what's wrong with my .htaccess file:

when I try to view the .htaccess file using Smartftp,it always reported there's is another ".htaccess" in the same directory and ask me whether I want to resume,overwrite or skip it,however,I'm sure I can only see ONE .htaccess file in that directory.

Is this a bug of Smartftp or an error of my server?

I totally missed the "VIEW" part of your post. Sorry.

 

As Glenn said, if you want to view that file, download it to your machine or view it with the File Manager in cPanel.

 

To answer your question you would want to "skip it".

 

I am assuming that Smartftp is opening the file and wants to rewrite it back to the server and the message is a warning asking if that's what you really want to do.

Link to comment
Share on other sites

Also, I use CuteFTP and it won't display files beginning with "."

I also use CuteFTP, and there is a way to view the .htaccess file as well as any other hidden files.

 

I'm using 6.0 Professional beta version, but I used to do it in previous versions, it just may be in a different menu selection.

 

In version 6.0, go to the View menu. Select Filter. In Filter Properties, check Enable server side filtering. Then in the Remote filter box, type in -a

 

This will make all files visible, and you can directly edit the file on the server, or transfer it to your local drive, edit it and upload it again.

Link to comment
Share on other sites

For those who might use AceFTP freeware or if TCH wants to do a How-to for different programs, the procedure is this:

 

1) Go to Site Properties within AceFTP 3

2) Click on the FOLDERS section

3) Uncheck "Use property class default value" box

4) Check radio button below "Use custom value"

5) Select the "-latr" option from the scrolldown menu below

Edited by Jikrantz
Link to comment
Share on other sites

I suspect that this is because when you select "view" it copies the .htaccess to your hard desk, so that it can then be opened in notepad or similar for you to view it. If you have "viewed" it before, then it will already have been copied to the temp file on your hard disk, hence prompts you asking if you would like to overwite the existing file (on your hard disk).

Link to comment
Share on other sites

Yes! Andy,

I remember the first time I viewed it the dialog box did not appear,

and I noticed:

"Existing File 400 bytes

Last changed 2004/5/4 PM 22:57 <---my local time

 

Replace with 400 bytes

Last changed 2004/5/4 AM 08:05 <---file's actual modified time"

Link to comment
Share on other sites

Also, I use CuteFTP and it won't display files beginning with "."

I also use CuteFTP, and there is a way to view the .htaccess file as well as any other hidden files.

 

I'm using 6.0 Professional beta version, but I used to do it in previous versions, it just may be in a different menu selection.

 

In version 6.0, go to the View menu. Select Filter. In Filter Properties, check Enable server side filtering. Then in the Remote filter box, type in -a

 

This will make all files visible, and you can directly edit the file on the server, or transfer it to your local drive, edit it and upload it again.

Thanks, Miriam but it doesn't appear to work in CuteFTP 3.5

 

Guess it's time to upgrade! :P

Link to comment
Share on other sites

Well, I never view the files online, I always download them to my harddrive to view; and I always get that popup because I download my .htaccess to the same place everytime (I have backups elsewhere). But I expect that.

 

Are you sure that you're able to view locally hidden files (ones with a . ?) perhaps you have a copy downloaded but can't see it. =)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...