Changes to RewriteRule in .htaccess not taking eff

2019-09-08 02:30发布

问题:

I had this rewrite rule set up in .htaccess and it was all working fine...

Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/mypage(.*)$ [NC]
RewriteRule ^(.*) http://example.com/PHProxy/poxy-0.5b2/index.php?url=http://example.org/mypage [L,R=302,NC]

However, when I change the url in the RewriteRule to http://example.com/PHProxy/poxy-0.5b2/index.php?url=http://example.org/mypage it still redirects to the old URL.

After some research, I added a syntax error into the .htaccess file to check the .htaccess file was being used (and indeed it was - as it resulted in an Internal Server Error when you tried to load a page from that directory).

There seems to be some caching somewhere, but I'm not sure. Any ideas why my change is not being picked up / how to troubleshoot and resolve?

回答1:

Problem solved. Just noticed that there is a mypage subdirectory which still contained the old rewrite rule, so that was the one being executed.