Forum Moderators: phranque

Message Too Old, No Replies

How do I replace .htaccess?

problems with replacing the .htaccess file

         

webmastertexas

5:38 pm on Aug 1, 2004 (gmt 0)

10+ Year Member



Hi. First of all, I have no idea if my web host uses Apache servers or not, but I'm ASSUMING they do. I recently made up and loaded an .htaccess file to stop hot-linking. (The file sort of disappeared when I changed the name to ".htaccess" in my FTP.) The result: nothing happened. I then did more investigating, and realized the code I originally used might not be correct, so I wrote up a correct one and uploaded it. I then tried to change the name to ".htaccess", but it didn't work. Instead, it gave me a message indicating that the file already exists, and it won't/can't replace it. This is very frustrating. Hot-linking is costing me a lot of bandwidth, and my site is pretty image intensive. I don't want to institute an annoying "no right click" java, as mentioned on this board, it will annoy visitors. But I just can't keep paying for extra bandwidth charges I'm not even using.

What does it mean if you can't replace the .htaccess file? Does it mean my web host DOESN'T have an Apache server? If not, how can I stop hot-linking?

Please go slow. I am new at this.

bedlam

6:01 pm on Aug 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have no idea if my web host uses Apache servers or not

Easiest thing to do is ask your host, but it seems probable since the file 'disappeared' when you renamed it. File names beginning with a '.' are hidden files on linux (and related) systems. So when you changed the file name, it became a hidden file and you could no longer see it.

Any decent ftp client should have an option somewhere to 'Show Hidden Files' or some such thing. Find that option and make sure it's selected (or, alternatively, get a better ftp client ;-) Then, you don't have to do the upload-it-and-change-the-file-name thing - the file on your hard drive, and the one on your hosting account can just have the same, correct filename.

... tried to change the name to ".htaccess", but it didn't work. Instead, it gave me a message indicating that the file already exists, and it won't/can't replace it ... What does it mean if you can't replace the .htaccess file?

It means what the error message says; you can't rename a file to the name of a file that already exists in the same directory.

-B

PS- I'd be willing to bet at least 25 cents that your hosting package includes some kind of 'Control Panel'.

If it does, get in there and start reading the help files; the better hosting control panels will a) tell you what operating system they run under, b) provide a web-based file-manager (which lets you rename, edit and delete files including hidden ones), and c) provide partly-automated hotlink protection.

jdMorgan

7:02 pm on Aug 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



webmastertexas,

Welcome to WebmasterWorld [webmasterworld.com]! -- I'm a six-pack northwest of Dallas... :)

Ask your server what kind it is [webmasterworld.com].

Jim

webmastertexas

7:11 pm on Aug 1, 2004 (gmt 0)

10+ Year Member



I've searched the control panel extensively, and there is nothing of the sort. I even called tech support, but they told me, quote, "We can't help you with that. You'll have to find out on your own." Seriously. This is what they said.

Okay. I'm downloading a copy of SmartFTP, since the one I use (Bulletproof) doesn't seem to have the "show hidden files" function. If SmartFTP doesn't work, can anyone recommend one that does?

Conard

8:17 pm on Aug 1, 2004 (gmt 0)

10+ Year Member



Ipswitch WS_FTP works well for me.

webmastertexas

8:18 pm on Aug 1, 2004 (gmt 0)

10+ Year Member



Update: As it turns out, bulletproof does allow me to see hidden files, but for some reason my .htaccess doesn't show up even after I've told it to "show hidden files". I tried putting all manner of codes, including: "-a" and "-al", but nothing. .htaccess never shows up. I'm basically stuck, guys. Does anyone have any other remedies for stopping hotlinking?

roldar

9:01 pm on Aug 1, 2004 (gmt 0)

10+ Year Member



>>I even called tech support, but they told me, quote, "We can't help you with that. You'll have to find out on your own."

You need to switch webhosts immediately. They're either incompetent or rude, either of which is unacceptable when there's a serious problem on their end that needs to be fixed.

webmastertexas

9:55 pm on Aug 1, 2004 (gmt 0)

10+ Year Member



I did the look-up provided by jdmorgan. Here's the info it spitted out. I have "X'ed" out my website, I hope that's all I need to hide so the mods don't have to do it. Does this answer the question of rather my host uses Apache servers? As you can probably guessed, I went with Yahoo's Web Hosting, simply because I started with them when I was just on Geocities (the free account) and upgraded little by little from there. For a newbie like me, they were very easy to use, so I stuck with them. Am I up a creek without a paddle?

HTTP/1.1 200 OK
Date: Sun, 01 Aug 2004 21:26:34 GMT
WWW-Authenticate: Basic realm="Password Protected Area"
X-Host: p1w7.geo.scd.yahoo.com
X-INKT-URI: [XXX...]
X-INKT-SITE: [XXX.com...]
Last-Modified: Sun, 01 Aug 2004 20:47:01 GMT
ETag: "ae1859-96d4-410d56c5"
Accept-Ranges: bytes
Content-Length: 39075
Connection: close
Content-Type: text/html

jdMorgan

1:40 am on Aug 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



webmastertexas,

It doesn't so much matter whether you can "see" the file - it matters that you can overwrite it when desired. Again, this depends on the FTP utility, but make sure that the unix file permissions are set to allow owner read and write.

I can't tell a darn thing from your host headers. In their infinite wisdom, Y! has apparently removed the usual server identification header. Here's a sample Apache response:


HTTP/1.1 200 OK
Date: Mon, 02 Aug 2004 01:35:33 GMT
Server: Rapidsite/Apa/1.3.31 (Unix) FrontPage/5.0.2.2510 mod_ssl/2.8.17 OpenSSL/0.9.7c
Cache-Control: must-revalidate, max-age=7200
Expires: Mon, 02 Aug 2004 03:35:33 GMT
Last-Modified: Thu, 29 July 2004 20:38:02 GMT
Connection: close
Content-Type: text/html

I suggest you ask Y! what platform you are hosted on, and get the details such as installed modules and application versions. This information will come in handy.

Jim

wilderness

3:11 am on Aug 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you have a Yahoo/Geo FREE page your abilities are going to very limited.

If you have PAID hosting with Yahoo? (not sure why anybody would choose this host though [JMHO] they prices and capacities can be beaten across the internet.)
[smallbusiness.yahoo.com...]
Which plan do you have?
If you have the starter pckg, Yahoo doesn't offer too much depth in accessories.

Yahoo provides a very minimum of explantions on this page.
[smallbusiness.yahoo.com...]

More extensive information on these pages:
[help.yahoo.com...]

Nearly every FTP software has an ability to display hidden/sys files, even though the software may not name them as such.
You might try looking for an option "File List Parameter"
and set that to "-a" I realize you mentioned this previously however, it is entirely possible to upload an htaccess file into any folder within your website and if your looking in a place other than where you have previously uploaded, then your hardly going to find it.
The htacess to work in all sub-folders should be uploaded in you ROOT folder. Most hosts name this folder public-html or www.

In the end, since likely nobody here has the same host or package as you, the only insights that may be provided are at best guesses. You'll just need to find another that has the same host, package and FTP software as yourself and look for help in that direction.

webmastertexas

11:21 am on Aug 2, 2004 (gmt 0)

10+ Year Member



Thanks, guys. I'm currently switching to another host. A more dependable one, hopefully. They come highly recommended by other webmasters.