+ Reply to Thread
Results 1 to 9 of 9

Thread: When I remove a line from my htaccess file it's still in effect

  1. #1
    onyxmoron is offline x10Hosting Member onyxmoron is an unknown quantity at this point
    Join Date
    Oct 2008
    Posts
    37

    When I remove a line from my htaccess file it's still in effect

    I'm testing using mod rewrite on my computer. When I add a rewrite rule to the htaccess file it goes into effect immediately (without even restarting Apache), but when I remove a line it still acts as if the line were there.

    For example, I created a rule to change requests for .htm to .php and it worked, but after removing that line from the htaccess file it keeps .htm to .php. I've restarted apache a hundred times and it's still happening. Even if I completely empty the htaccess file, save it, and restat apache, all of the rules that were there before continue to be in effect.

    EDIT: Never mind, for some reason when I was pressing ctrl+s in notepad to save htaccess the whole time the file wasn't actually saving. :nuts: Am I missing something or can we not close our own threads any more, or delete them?
    Last edited by onyxmoron; 01-26-2009 at 05:04 AM.

  2. #2
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: When I remove a line from my htaccess file it's still in effect

    As you probably know, saving files without a filename as in .htaccess and .htpasswd does cause some problems. I had to do mine through cmd prompt. Windows is a nightmare!

  3. #3
    onyxmoron is offline x10Hosting Member onyxmoron is an unknown quantity at this point
    Join Date
    Oct 2008
    Posts
    37

    Re: When I remove a line from my htaccess file it's still in effect

    Quote Originally Posted by freecrm View Post
    As you probably know, saving files without a filename as in .htaccess and .htpasswd does cause some problems. I had to do mine through cmd prompt. Windows is a nightmare!
    I'm not sure if that's what it was. It was working fine for a while, then this problem suddenly appeared where it didn't seem to be updating anymore when I changed something and reloaded the page. After a while, when I coudln't find an answer anywhere, I looked at the file in windows explorer and for some reason according to the "last modified" value it hadn't been overwritten for ten minutes, even though I had been ctrl+s'ing the whole time. :dunno: After that it worked fine again.

    What version of windows do you have? In XP, to save .htaccess files all you have to do is create them in notepad, choose "all files" from the "save as type" pulldown menu, and save with the name ".htaccess". To load them you have to open the file directly from inside notepad (not from explorer etc, since it gives an error).

  4. #4
    nightscream is offline x10 Lieutenant nightscream is an unknown quantity at this point
    Join Date
    Feb 2006
    Location
    Hallaar, Belgium
    Posts
    474

    Re: When I remove a line from my htaccess file it's still in effect

    what you also can do is remove .htaccess and create a fresh one(copy paste)
    ------------------------------------------------------------------------------------------
    If you have any troubles with a website or a script, just send me a pm.

    I also code websites in xHTML/css, can code javascript and php too if needed

  5. #5
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: When I remove a line from my htaccess file it's still in effect

    I also use XP (since Vista is even worse!) but the same problems arise.

    Opening in notepad is fine, but saving is where you have your problem. The saving as type just affects the extension .htaccess but it is also expecting a filename - which is why you get a problem because .htaccess files have no filename.

    I got round this problem by saving as "file.htaccess" and then deleting the "file" in cmd, leaving you with just the .htaccess extension.

  6. #6
    onyxmoron is offline x10Hosting Member onyxmoron is an unknown quantity at this point
    Join Date
    Oct 2008
    Posts
    37

    Re: When I remove a line from my htaccess file it's still in effect

    OK, I was wrong - this problem is happening again. I physically removed the htaccess file from the folder and it's still acting like it's there. The mod rewrite rules I wrote in it are still being processed, even though there's no htaccess file there. Has it been cached or something? How can I clear it from the cache if that's the case?

    EDIT: After experimenting more, if I change a rule in the htaccess file the change goes into effect immediately, but if I delete a rule or comment it out it's still in effect. Is this supposed to happen?
    Last edited by onyxmoron; 01-28-2009 at 12:15 AM.

  7. #7
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: When I remove a line from my htaccess file it's still in effect

    Quote Originally Posted by onyxmoron View Post
    OK, I was wrong - this problem is happening again. I physically removed the htaccess file from the folder and it's still acting like it's there. The mod rewrite rules I wrote in it are still being processed, even though there's no htaccess file there. Has it been cached or something? How can I clear it from the cache if that's the case?

    EDIT: After experimenting more, if I change a rule in the htaccess file the change goes into effect immediately, but if I delete a rule or comment it out it's still in effect. Is this supposed to happen?
    I must admit, I thought these cleared on browser close...:nuts:

  8. #8
    onyxmoron is offline x10Hosting Member onyxmoron is an unknown quantity at this point
    Join Date
    Oct 2008
    Posts
    37

    Re: When I remove a line from my htaccess file it's still in effect

    Quote Originally Posted by freecrm View Post
    I must admit, I thought these cleared on browser close...:nuts:
    It's not even related to the browser - I checked the page in IE and it was doing the same thing even though I hadn't used IE at all since before I added the htaccess file in the first place (so it couldn't have been cached).

    Maybe it's just a mystery, or maybe it's just because I really don't know what I'm doing. ;)

  9. #9
    rsguthix is offline x10Hosting Member rsguthix is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    9

    Re: When I remove a line from my htaccess file it's still in effect

    If you have a .htaccess in the directory above doesn't that affect it?

+ Reply to Thread

Similar Threads

  1. GeIP Script Help
    By cybahq in forum Free Hosting
    Replies: 4
    Last Post: 07-30-2008, 05:08 AM
  2. Server Time-Zone To Local Time-Zone
    By rockee in forum Tutorials
    Replies: 4
    Last Post: 06-02-2008, 09:58 AM
  3. perl script for guestbook, need help
    By shifeng in forum Scripts & 3rd Party Apps
    Replies: 14
    Last Post: 01-06-2008, 12:31 PM
  4. Uploading file problem
    By HyDr@ in forum Free Hosting
    Replies: 5
    Last Post: 08-28-2006, 12:54 PM
  5. Converting a .RMVB file
    By SEŅOR in forum Off Topic
    Replies: 7
    Last Post: 06-19-2006, 02:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers