sitemap.xml с и без www
Здравствуйте все.
Странную вещь обнаружил. Если смотрю на https://www.example.com/xml/sitemap.xml то всё нормально.
А если без www смотрю на https://example.com/xml/sitemap.xml то вижу ошибку стилей:
Ошибка загрузки таблицы стилей: Произошла неизвестная ошибка (805303f4)
https://www.example.com/theme/_common/sitemap.xsl
Гугл говорит что исправить можно в .htaccess.
Как именно правильно это написать для Ваки?
Comments
Log in or create an account to post a comment.
Re: sitemap.xml с и без www
Referrer-Policy: strict-origin-when-cross-originviolationhttps://www.example.comwon't loadhttps://example.comlinks or vice versa withstrict-origin-when-cross-originpolicy in place, Security Header issue that affects CSP and Referrer-Policy.Solution:
/theme/_common/sitemap.xslTo make matters worse, I have my own redirect zoo in root mainly to redirect www. and legacy locations.
There are similar issues with
canonicalURLs on regarding thewww.prefix.To completely disable the www prefix in URLs on an Apache server, you must configure a redirect from
www.example.comtoexample.comusing either.htaccessor the Apache virtual host configuration.RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]Despite this server-side redirection, the PHP
$_SERVER['SERVER_NAME']variable may still reflect thewww.prefix if the server configuration or the request's initial host header is not properly normalized. This is because$_SERVER['SERVER_NAME']is derived from the HTTP request headers and may not be updated by the rewrite rule if the server does not re-evaluate the host header after the redirect.So in the current configuration if you chose to use
www.prefix redirect disable$this->canonicalURLs.Perhaps it is useful the add an option in the
get_base_url()function in the Settings class that removes thewww.prefix from the$base_url. Is there another way to address this www. prefix alias mess?base_urlbase_pathОтвет: sitemap.xml с и без www
diff --git a/src/class/feed.php b/src/class/feed.php
теперь нормально в обоих вариантах.
Спасибо WikiAdmin!
Ответ: sitemap.xml с и без www
надпись Syntax error, unexpected ' = '
Ответ: sitemap.xml с и без www
а возле кнопки всегда:
Период, дней: 0. Последний раз записано 1970–01–01 00:00:01.
Re: sitemap.xml с и без www
??=operator in PHP is known as the null coalescing assignment operator. It was introduced in PHP 7.0 as a shorthand way to assign a value to a variable only if that variable is currentlynull.What causes the error?
Re: sitemap.xml с и без www
xml_sitemap_time >= 0, because the time is not required, but we can set it there too.