- Issue created by @2dareis2do
- last update
9 months ago 29,593 pass, 1 fail 17:40 42:33 Running- π¬π§United Kingdom longwave UK
According to the docs, the RewriteCond syntax we use is correct: https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#rewritecond
CondPattern is usually a perl compatible regular expression, but there is additional syntax available to perform other useful tests against the Teststring:
You can prefix the pattern string with a '!' character (exclamation mark) to negate the result of the condition, no matter what kind of CondPattern is used.
=CondPattern
Lexicographically equal
Treats the CondPattern as a plain string and compares it lexicographically to TestString. True if TestString is lexicographically equal to CondPattern (the two strings are exactly equal, character for character).So there should be no need to escape the slash - the
!=
prefix compares an exact string, not a regular expression. It looks like VSCode has a highlighting bug when this syntax is used, as it appears to still be interpreting it as a regex. - π¬π§United Kingdom longwave UK
Also the favicon change is by design. Each theme is allowed to specify its own favicon in the theme settings; admin themes often use a different favicon to the frontend theme. However, browsers also like to cache the favicon sometimes so in some cases the wrong icon can show when switching between frontend and backend.
- π¬π§United Kingdom 2dareis2do
Thanks for looking at this Dave,
Interesting to see where this is documented and good to know this is using a
condPattern
.As this is not a perl reg expression, this is probably the wrong approach.
Maybe my plesk apache is also interpreting it as a reg expression somehow?? Certainly doing a search there are a few similar threads on this:
https://talk.plesk.com/threads/cant-get-rid-of-index-php-prefix-from-all...
https://drupal.stackexchange.com/questions/257581/links-on-site-adding-i...also with nginx
https://www.drupal.org/forum/support/post-installation/2020-04-06/solved... βSo according to official docs it says:
Note
The string comparison operator is part of the CondPattern argument and must be included in the quotes if those are used. Eg.
RewriteCond %{HTTP_USER_AGENT} "=This Robot/1.0"So it seems to me we could also rewrite like so and would also be valid?
RewriteCond %{REQUEST_URI} "!=/favicon.ico"
With regards the favicon, I was surprised to actually see the favicon changing as the page loads as I have also had experience where the browser caches this. But my feeling is it should behave consistently for all admin pages if favicon is in the doc/webroot and favicon is not part of admin theme or set globally theme.
One thing that did surprise me is that claro seems to provide an option to `Use the favicon supplied by the theme` however there is no favicon there afaict. I guess this must be inherited from global theme settings, however when this is disabled it is not longer available as an option. As you say it's possible that the browser is caching this after disabling that one as well, but seemed different for each admin path hence the screenshot.
- last update
9 months ago 29,653 pass - π¬π§United Kingdom 2dareis2do
Ok I have installed Apache config extension and VSCode is interpreting CondPattern in .htaccess without issue now.
I will see if the issue surfaces when running on Plesk but looking at in in more detail, seems more than like some coincidence.
.
- π¬π§United Kingdom 2dareis2do
I had this come up again.
Wrapping "!=/favicon.ico" in quote marks seems to help? After restarting apache (twice!) and then clearing cache.
The odd thing is when restarting apache I get nginx server is not available!?
Will try and raise an issue in plesk forum to see if there is an issue there.
- π¬π§United Kingdom longwave UK
I don't think there is anything for Drupal to change here, this appears to be an issue with Plesk, so there is no bug for us to fix. It seems possible that Plesk doesn't support this advanced RewriteCond syntax for some reason.
- π¬π§United Kingdom 2dareis2do
I have discovered this issue which looks similar. e.g. index.php randomly appears in friendly URLs
https://www.drupal.org/project/drupal/issues/3050261 π index.php randomly appears in friendly URLs Active
- Status changed to Closed: duplicate
4 months ago 11:33am 4 March 2024