php.htaccesscachingcookiesbitrix

.htaccess Weird behaviour with cookies


I have this .htaccess file. What I'm trying to achieve is when I go to site/about/ -> site/sitemap. Otherwise when I go to site/about/me -> site/about/me.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
Redirect 301 /about/index.php /sitemap/   <- my custom rule

The thing is - it's working, but when I, for instance, comment out that custom rule, save and then go test it, the rule still works, though it's been commented out. To actually see the changes I should do it via "Incognito mode".

So, that's the question - why is it happening (cookies, cache or what?) and how to fix it if possible?


Solution

  • As stated in similar question here Apache - how to disable browser caching while debugging htaccess browsers do cache resolved 301 redirects.

    You could leave Dev tools open with "Disable cache (while DevTools is open)" option ticked.

    I like to use low level curl command to check things like that, or course as long as the output is at least readable enough to tell me which page is served. curl -v http://example.com/ will give out full headers and response output without caching anything. Note that it can't show internal rewrite rules, but still will show the output of that rewrites.