Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
After renaming .htaccess did you reload or restart apache? Try this and see it helps /etc/init.d/apache2 reload –  ZVIK Oct 8 '13 at 9:32
    
Yes I even reinstalled it –  Adam Oct 8 '13 at 9:33
    
Ok 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... –  Adam Oct 8 '13 at 10:04
    
I have solved the issue by adding: Options -Multiviews –  Adam Oct 8 '13 at 10:49

2 Answers 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

share|improve this answer
    
I've cleared it, tried different computers and accessed it by IP instead of a hosts file domain, still working –  Adam Oct 8 '13 at 9:32
    
strange. what happens when you move the file out of your docroot? –  that guy from over there Oct 8 '13 at 9:36
    
and 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 –  that guy from over there Oct 8 '13 at 9:38
    
I 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 Oct 8 '13 at 9:46
    
Ok 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... –  Adam Oct 8 '13 at 10:06

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.