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

onyxmoron

New Member
Messages
37
Reaction score
0
Points
0
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:

freecrm

New Member
Messages
629
Reaction score
0
Points
0
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!
 

onyxmoron

New Member
Messages
37
Reaction score
0
Points
0
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).
 

freecrm

New Member
Messages
629
Reaction score
0
Points
0
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.
 

onyxmoron

New Member
Messages
37
Reaction score
0
Points
0
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:

freecrm

New Member
Messages
629
Reaction score
0
Points
0
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:
 

onyxmoron

New Member
Messages
37
Reaction score
0
Points
0
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. ;)
 

rsguthix

New Member
Messages
9
Reaction score
0
Points
0
If you have a .htaccess in the directory above doesn't that affect it?
 
Top