Moved_XH Problem?

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
manu
Posts: 1090
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Moved_XH Problem?

Post by manu » Thu Aug 27, 2015 8:01 am

I'm just stuck with Moved_XH:

Code: Select all

Holzboote-Reparaturen=Holzboote
Holzboote-Reparaturen:Delphin-Jolle=Holzboote:Delphin-Jolle
The top level page rule works, but the sublevel page rule don't.
Any ideas?
regards manu

manu
Posts: 1090
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: Moved_XH Problem?

Post by manu » Thu Aug 27, 2015 8:47 am

It acts really strange.. It seems if the rule meets it does a something like a page.back instead of pointing to the new page.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Moved_XH Problem?

Post by cmb » Thu Aug 27, 2015 11:24 am

Is your uri_seperator [sic!] really a colon?

What does the browser's address line display when you visit Holzboote-Reparaturen:Delphin-Jolle?
Christoph M. Becker – Plugins for CMSimple_XH

manu
Posts: 1090
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: Moved_XH Problem?

Post by manu » Thu Aug 27, 2015 2:39 pm

cmb wrote:Is your uri_seperator [sic!] really a colon?

What does the browser's address line display when you visit Holzboote-Reparaturen:Delphin-Jolle?
Hi Christoph.
Yes, the uri_seperator is old_fashioned a colon. Other sublevel pages can be opened.
When I call ?Holzboote-Reparaturen:Delphin-Jolle it seems it jumps to the previous opened page. A ?Holzboote-ReparaturenXXX:Delphin-Jolle call return a 404page.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Moved_XH Problem?

Post by cmb » Thu Aug 27, 2015 2:54 pm

Hi manu,
manu wrote:When I call ?Holzboote-Reparaturen:Delphin-Jolle it seems it jumps to the previous opened page.
That's rather strange. Please have a look at the browser dev tools, network tab (or whatever it's called). There should be an option to preserve the log after navigation. Then request ?Holzboote-Reparaturen:Delphin-Jolle again, and have a look at the response headers. There should be a Location header field. Is that the same as where the browser has redirected to?
Christoph M. Becker – Plugins for CMSimple_XH

manu
Posts: 1090
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: Moved_XH Problem?

Post by manu » Thu Aug 27, 2015 4:07 pm

in Chrome I get Method GET, Status "(canceled)" instead of 200 ok.

manu
Posts: 1090
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: Moved_XH Problem?

Post by manu » Thu Aug 27, 2015 4:27 pm

It seems like the ":" seperator is absolutely lethal for the custom_404 function. $parts['scheme'] returns 'Holzboote' on moved/index.php line 184...

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Moved_XH Problem?

Post by cmb » Thu Aug 27, 2015 5:16 pm

manu wrote:It seems like the ":" seperator is absolutely lethal for the custom_404 function. $parts['scheme'] returns 'Holzboote' on moved/index.php line 184...
Ah! Thanks for investigating. :)

The problem is parse_url() which is known to have limitations for partial URLs. Some of these have been lifted over time, but in this case we're out of luck. Filing a bug report against PHP doesn't seem to be appropriate, though, because "'Holzboote-Reparaturen:Delphin-Jolle'" is a valid URL, albeit not a valid URI.

I guess I'll have to rewrite the respective code. As a quick fix for those who do not have any absolute URLs (including the scheme) in the data file, changing line 183ff to the following might be sufficient:

Code: Select all

                $qs = strpos($_SERVER['QUERY_STRING'], $su) === 0
                    ? substr($_SERVER['QUERY_STRING'], strlen($su))
                    : '';
                $url = MOVED_URL . '?' . $records[$su] . $qs;
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply