Textpattern CMS support forum

You are not logged in. Register | Login | Help

#131 2018-09-08 14:27:07

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,273
Website

Re: Testers needed: flat development (4.7+ only)

I’m using pat_speeder v1.1 with my build-in sitemap (as you try to accomplish) without any kind of problems: https://www.cara-tm.com/sitemap-xml

!https://preview.ibb.co/db8iC9/sitemap_hreflang.png!

(https://github.com/cara-tm/RSS-Sitemap-for-Textpattern-CMS)

Last edited by Pat64 (2018-09-08 14:40:22)


Patrick.

Github | CodePen | Simplr theme | Wait Me a maintenance theme

Offline

#132 2018-09-08 14:55:54

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,291
Website

Re: Testers needed: flat development (4.7+ only)

etc wrote #313924:

<txp:header /> after <?xml version="1.0" encoding="UTF-8"?>

That did it. Thanks so much Oleg!

The problem now is with the htaccess. This does not work

<IfModule mod_rewrite.c>
	RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

	#RewriteBase /relative/web/path/
	RewriteRule ^sitemap.xml$  ./sitemap/ [L]
	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^(.+) - [PT,L]

	RewriteCond %{REQUEST_URI} !=/favicon.ico
	RewriteRule ^(.*) index.php

	RewriteCond %{HTTP:Authorization}  !^$
	RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>


# SVG
<IfModule mod_mime.c>
	AddType image/svg+xml  svg svgz
	AddEncoding gzip       svgz
</IfModule>

Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#133 2018-09-08 18:10:19

singaz
Member
Registered: 2017-03-12
Posts: 69

Re: Testers needed: flat development (4.7+ only)

Here is the working configuration

page template:

<?xml version="1.0" encoding="UTF-8"?><txp:header value="application/xml; charset=utf-8" />
<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">
<txp:section_list break="" exclude="sitemap,info">
<url>
    <loc><txp:section url="1" /></loc>
<txp:evaluate test="article_custom">
    <lastmod><txp:article_custom section='<txp:section />' limit="1" sort="LastMod desc"><txp:modified format="%Y-%m-%d" /></txp:article_custom></lastmod>
</txp:evaluate>
</url>
</txp:section_list>
<txp:article_custom section="sections1,sections2,sections3" limit="9999">
<url>
    <loc><txp:permlink /></loc>
    <lastmod><txp:modified format="%Y-%m-%d" /></lastmod>
</url>
</txp:article_custom>
</urlset>

with such file .htaccess works www.mydomain.com/sitemap.xml:

# BEGIN Textpattern
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default
<IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteBase /relative/web/path/
# sitemap rewrite
    RewriteRule ^sitemap.xml$  index.php?s=sitemap [L]
	RewriteCond %{HTTPS} !=on [OR]
	RewriteCond %{HTTP_HOST} ^www\. [NC]
	RewriteRule ^(.*)$ https://mydomain.com/$1 [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+) - [PT,L]
    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteRule ^(.*) index.php
    RewriteCond %{HTTP:Authorization}  !^$
    RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
#php_value register_globals 0
<IfModule mod_mime.c>
    AddType image/svg+xml  svg svgz
    AddEncoding gzip       svgz
</IfModule>
# END Textpattern

Thank you all!


Sorry my horror English. I’m learning textpattern, I’m learning English

Offline

#134 2018-09-08 20:14:49

etc
Developer
Registered: 2010-11-11
Posts: 3,201
Website

Re: Testers needed: flat development (4.7+ only)

Pat64 wrote #313929:

I’m using pat_speeder v1.1 with my build-in sitemap (as you try to accomplish) without any kind of problems: https://www.cara-tm.com/sitemap-xml

Hi Patrick, no offense intended, that just was the only plugin in Yiannis list that alters the page output, hence an easy suspect, sorry. Also, from what I’ve understood, you need to put it at the very beginning, so an eventual linebreak after it invalidates XML.

This makes me think that we should trim the final page output before serving it. I don’t see why anyone would need to start his pages with a space or a linebreak. Edit: done.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#135 2018-09-09 06:05:32

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 752
Website

Re: Testers needed: flat development (4.7+ only)

I do not know if it helps, but in the backend, all screens have this extra white character, except the plugins screen.

Offline

#136 2018-09-09 06:38:47

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 752
Website

Re: Testers needed: flat development (4.7+ only)

I put all the 4.7.1 files on the server: same problem.

This makes me think that we should trim the final page output before serving it. I don’t see why anyone would need to start his pages with a space or a linebreak. Edit: done.

But I uploaded the latest version 4.7.2 with the latest Oleg commits: same problem
I also changed the theme, returning to Hive: always the same thing.
Every time I emptied the cache of FFox and reloaded the pages.

Offline

#137 2018-09-09 06:46:01

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,677
Website

Re: Testers needed: flat development (4.7+ only)

jpdupont wrote #313937:

I put all the 4.7.1 files on the server: same problem.

But I uploaded the latest version 4.7.2 with the latest Oleg commits: same problem
I also changed the theme, returning to Hive: always the same thing.
Every time I emptied the cache of FFox and reloaded the pages.

Weird. On my various installs, locally or live servers, there is no white-space character before the <!doctype…> on the admin side (or the front-end). Have you tried disabling plugins to see if that changes anything? (and you did check ‘view source’, right?)

Offline

#138 2018-09-09 06:54:45

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 752
Website

Re: Testers needed: flat development (4.7+ only)

Yes, I check view source.

I just put the site in work mode and i try now to disable the plugins.

Offline

#139 2018-09-09 07:22:17

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 752
Website

Re: Testers needed: flat development (4.7+ only)

That’s it, I found the culprit!

It’s the mck_snippet plugin that I liked to use to store texts that should not be mixed with articles.

Something that is missing in Textpattern, and that could find its place next to other “media”: files, images, links …
I’m going to do without it, and he goes to the trash …

Offline

#140 2018-09-09 07:26:22

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,677
Website

Re: Testers needed: flat development (4.7+ only)

jpdupont wrote #313940:

That’s it, I found the culprit!

Great! One step closer to nirvana.

Offline

Board footer

Powered by FluxBB