0

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?

Monstryyy
  • 81
  • 9

1 Answers1

1

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.

Community
  • 1
  • 1
Grawer
  • 121
  • 3
  • That link actually explains everything, shame on me. But thanks for additional info about Dev tools and curl, from now on I'll def stick to one of those. Just to clarify, my code is right and the whole cache thing is how it should be working? Anyway, thx a lot for answering! – Monstryyy Jan 25 '17 at 21:17
  • Your code seems to be right for me. The minor difference is that you wrote "I go to site/about/" and the rule is "/about/index.php" which isn't exactly the same, but would be functionally equal. – Grawer Jan 26 '17 at 17:44