Forum

Thread tagged as: Question

bad link to subdomain in sitemap.xml

One of the links in my main navigation goes to a subdomain not part of perch - app.website.com.

In my sitemap xml it's coming out as:

https://www.website.comhttps://app.website.com

That's because I have this set up in the sitemap.html template:

<loc>https://www.website.com<perch:pages id="pagePath" /></loc>

Do I need to edit my sitemap.xml file (below) so all items display the correct url? Thank you.

<?php
    header('Content-type: application/xml');
    include('admin/runtime.php');
    perch_pages_navigation(array(
        'template'=>'sitemap.html',
        'flat'=>true,
    'hide-extensions' => true
      ));
?>
Stephen Turvey

Stephen Turvey 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

<loc>
<perch:if id="pagePath" match="regex" value="http">
    <perch:pages id="pagePath" />
<perch:else />
    https://www.website.com<perch:pages id="pagePath" />
</perch:if>
</loc>

That isn't working I'm afraid - gives me the same output. I also tested swapping it round like so...

<loc>
<perch:if id="pagePath" match="regex" value="http">
    https://www.website.com<perch:pages id="pagePath" />
<perch:else />
    <perch:pages id="pagePath" />
</perch:if>
</loc>

...And then the subdomain displays correctly but the standard links only include the filename and not the full URL.

In case it matters - I have perch itself installed on a subdomain - so all the main files at perch.website.com and the non perch stuff at app.website.com

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's surprising. The path does include http, yes?

yes it does

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show me your diagnostics report?

Sure:

Perch: 2.8.29
Production mode: Production (100)
Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), ketterus_autoreply (1.3), perch_blog (5.0), perch_forms (1.8.3), perch_members (1.5), perch_mailchimp (3.0.1)
DB driver: PDO
DB tables: perch2_blog_authors (2), perch2_blog_comments (0), perch2_blog_index (125), perch2_blog_posts (3), perch2_blog_posts_to_tags (0), perch2_blog_sections (1), perch2_blog_tags (0), perch2_blogs (1), perch2_categories (9), perch2_category_counts (2), perch2_category_sets (1), perch2_content_index (2905), perch2_content_items (479), perch2_content_regions (65), perch2_forms (2), perch2_forms_responses (10), perch2_ketterus_autoreply_logs (4), perch2_ketterus_autoreply_replys (7), perch2_mailchimp_campaigns (0), perch2_mailchimp_imports (0), perch2_mailchimp_lists (1), perch2_mailchimp_subscribers (9), perch2_mailchimp_subscriptions (9), perch2_mailchimp_webhooks (1), perch2_members (0), perch2_members_forms (0), perch2_members_member_tags (0), perch2_members_sessions (0), perch2_members_tags (0), perch2_navigation (3), perch2_navigation_pages (9), perch2_page_templates (1), perch2_pages (19), perch2_resource_log (364), perch2_resource_tags (0), perch2_resources (160), perch2_resources_to_tags (0), perch2_settings (30), perch2_user_passwords (0), perch2_user_privileges (41), perch2_user_role_privileges (33), perch2_user_roles (2), perch2_users (2)
Users: 2
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'ketterus_autoreply',
        'perch_blog',
        'perch_members',
        'perch_mailchimp',
        'perch_forms',
    );  

Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Scheduled tasks for perch_mailchimp: import_data (1 mins)
Editor plug-ins: markitup, ckeditor
H1: 0ac2e63eca57905fb99403a1fdff5843
L1: db40973f68cd2b9f1323e6ef26b76185
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 0
lang: en-gb
update_2.8.29: done
latest_version: 2.8.15
on_sale_version: 2.8.29
ketterus_autoreply_update: 1.3
perch_blog_update: 5.0.1
perch_blog_post_url: /blog/{postSlug}
headerScheme: light
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
perch_mailchimp_api_key: 7bf52f254ce10494f929ce16702bf4be-us13
perch_mailchimp_campaign_url: /mailchimp/campaign/{campaignSlug}
perch_members_login_page: /members/login.php?r={returnURL}
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
ketterus_autoreply_logAll: 1
perch_blog_comment_notify: 0
ketterus_autoreply_sitePath: /home/yepdouk1/public_html/website/
perch_blog_site_name: Website
perch_mailchimp_secret: 03048a0
perch_members_update: 1.4
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: yepdouk1
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: yepdouk1_website
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: stephen@yepd.co.uk
PERCH_EMAIL_FROM_NAME: Stephen Turvey
PERCH_LOGINPATH: /admin
PERCH_PATH: /home/yepdouk1/public_html/website/admin
PERCH_CORE: /home/yepdouk1/public_html/website/admin/core
PERCH_RESFILEPATH: /home/yepdouk1/public_html/website/admin/resources
PERCH_RESPATH: /admin/resources
PERCH_HTML5: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/yepdouk1/public_html/website/admin/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 5.5.36
Zend: 2.5.0
OS: Linux
SAPI: litespeed
Safe mode: not detected
MySQL client: 10.0.20-MariaDB
MySQL server: 10.0.20-MariaDB-cll-lve
Free disk space: 1.55 TB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, mbstring, tokenizer, xml, litespeed, bcmath, dom, gd, imap, intl, json, exif, mcrypt, mysql, mysqli, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, sockets, xmlreader, xmlwriter, mhash
GD: Yes
ImageMagick: No
PHP max upload size: 100M
PHP max form post size: 100M
PHP memory limit: 128M
Total max uploadable file size: 100M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
PATH: /usr/local/bin:/usr/bin:/bin
TEMP: /tmp
TMP: /tmp
TMPDIR: /tmp
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,es;q=0.6
HTTP_CONNECTION: close
HTTP_COOKIE: optimizelyEndUserId=oeu1455730691523r0.9362147212959826; optimizelySegments=%7B%22232670684%22%3A%22direct%22%2C%22232739667%22%3A%22gc%22%2C%22232884298%22%3A%22false%22%2C%223542021084%22%3A%22none%22%7D; optimizelyBuckets=%7B%7D; __utma=158063154.1124227701.1440664033.1465829593.1465844512.34; __utmz=158063154.1464018961.31.6.utmcsr=website.yepd.co.uk|utmccn=(referral)|utmcmd=referral|utmcct=/index.php; _ga=GA1.3.1124227701.1440664033; cmsa=1; PHPSESSID=4jp9i1i8kac5jsk8qrtdtke767
HTTP_HOST: website.yepd.co.uk
HTTP_REFERER: https://website.yepd.co.uk/admin/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
HTTP_X_FORWARDED_FOR: 181.133.165.163
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_DNT: 1
UNIQUE_ID: V2qmh01IAEIACZX07p0AAACE
SERVER_SOFTWARE: Apache
SERVER_NAME: website.yepd.co.uk
SERVER_ADDR: 77.72.0.66
SERVER_PORT: 80
REMOTE_ADDR: 181.133.165.163
DOCUMENT_ROOT: /home/yepdouk1/public_html/website
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: /home/yepdouk1/public_html/website
SERVER_ADMIN: webmaster@website.yepd.co.uk
SCRIPT_FILENAME: /home/yepdouk1/public_html/website/admin/core/settings/diagnostics/index.php
REMOTE_PORT: 36026
SERVER_PROTOCOL: HTTP/1.0
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /admin/core/settings/diagnostics/?extended
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
PHP_SELF: /admin/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1466607239.2544
REQUEST_TIME: 1466607239