Server remembering old rewrite rules, even when I remove htaccess
Solution 1
It might be worth to check whether the caching happens on the client and not server-side. Firefox will cache any 301 (PERMANLTY moved)-redirecteds for a few days. Use 302 (temporary) redirect. To fix "old targets" you can set up an html page redirecting to another domain (e.g. without www) etc. to prevent firefox from using its cache.
Solution 2
Is there a place with cached rules? I've never had this problem before!
(usually) not server-side, but client / browser-side; try to cache-clean your browser as well
EDIT 1
suggestion: move out the .htaccess - file from your docroot. when there are still rewrite-rules active, they must be somwhere: either in your docroot or in <virtualserver>
- config. to disable htaccess for your docroot, add the following to your server-config:
<virtualHost>
...
DocumentRoot /some/path
...
<Directory /some/path>
AllowOverride None
</Directory>
</VirtualHost>
- restart apache
If your are sure your dont have any RewriteRule in your Server-Config AND with teh snippet above still get rewrites, i smell fish
Related videos on Youtube
Adam
Updated on September 18, 2022Comments
-
Adam over 1 year
I have set up a development server with Ubuntu and LAMP, but for some reason the
.htaccess
is acting strange...There is a site on there with a set of rules, when I comment them out they still work, and even when I renamed the file to
.htaccesss
it still works! If I delete everything in the file it still works, restarting Apache every time I make a change...I have tried reinstalling Apache and reinstalled the rewrite module, and it still doesn't work...
Any new rules I add seem to not have any affect at all, so it is reading the rules from somewhere else it seems.
If I cause a syntax error by putting a / in the
.htaccess
file I do get a 500 server error.Is there a place with cached rules? I've never had this problem before!
EDIT: I solved this problem by adding
Options -Multiviews
in my.htaccess
file -
that guy from over there over 10 yearsstrange. what happens when you move the file out of your docroot?
-
that guy from over there over 10 yearsand there is a special rewrite-log; i'd turn it on on loglevel 5-9 and see whats happening. after this, i'd
cd $docroot && find ./ -name '.ht*' -ls
; maybe some file is accidentially placed somewhere else in your docroot -
Adam over 10 yearsI just noted when I ran usr/sbin/apache2 -V it says: "Server compiled with.... -D APACHE_MPM_DIR="server/mpm/prefork" isn't that supposed to say httpd.conf?
-
Adam over 10 yearsOk I have looked in the log and it seems there is something called a pass through active? its basically removing the php extension but I have no idea where it is coming from...
-
that guy from over there over 10 yearssee my edits above