Redirecting xmlrpc.php and update.php

sdrycroft - January 16, 2008 - 11:34
Project:Path redirect
Version:5.x-1.1-beta1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

It's taken me a little while to discover this bug, and which module are responsible, but it looks to me to be a combination of this module, and path_auto. I'll try and explain what is happening.

On a number of our sites users have a static front page set, and have set the URL to this on the site information admin page (e.g. to homepage). We now have the path_auto module installed, which rewrites the short URLs of pages to content/[page-title]. If a user edits their home page the URL is changed, and a redirect from the old (homepage) is put in place. It is this redirect that appears to be causing the problems, as it is being called when running update.php and xmlrpc.php. A simple fix for this would be to check that it is index.php that is being called in the path_redirect_init function, or to update the site_frontpage variable with the correct value if it is changed.

Adding the following line to the top of path_redirect_init fixes this problem for us:


if($_SERVER['SCRIPT_NAME']!='index.php'){return;}

#1

HorsePunchKid - January 19, 2008 - 21:15
Status:active» needs review

This patch does basically the same thing but preserves the single entry point from the function. Note that the comparison is slightly different: On my server, I needed to check for '/index.php' rather than just 'index.php'. I'm not sure if there's something important in that difference.

AttachmentSize
path_redirect-5.x-1.x_index_1.patch 2 KB

#2

sdrycroft - January 22, 2008 - 18:05

'/index.php' here also. A clumsy typo I'm afraid.

Simon

#3

HorsePunchKid - January 26, 2008 - 23:45
Status:needs review» postponed (maintainer needs more info)

I read through your description again, and I have to say I'm not quite seeing where the problem is. It seems like the fundamental problem is that pathauto is creating bad aliases for you. Could you give an example of exactly what kind of bad alias is being created? There's at least one other issue still open in which pathauto is creating a bad alias, so maybe preventing that is a better solution.

Also, I'd be curious if the problem still occurs with the latest dev version. It has a significantly different block of code for determining the "from" URL which may obviate this patch anyway.

#4

sdrycroft - February 6, 2008 - 16:23

Do the following:

- Create a page, give it an alias, e.g. "homepage" (rather than accepting the one created by path auto)
- Set the front page of your site to this alias (under administer -> site information)
- Edit the node created in step one so that a new alias is created for it (this could be content/my-home-page or anything else)
- Assuming that everything is set up correctly, you should now have the following:

example.com/ front page of site, displays the content of example.com/homepage which is in fact a redirect to example.com/content/my-home-page

It is this redirect from / to content/my-home-page which causes the problem with xmlrpc.php and update.php. The problem is with the Path Redirect module, and not with the pathauto module. Another fix for this would be for pathauto to update the site information setting for the front page of a site, ideally both fixes should be implemented.

#5

Dave Reid - January 28, 2009 - 01:48
Status:postponed (maintainer needs more info)» fixed

This is a very convoluted bug that I don't think most people will encounter. I tried to duplicate this using the latest modules version on Drupal 6.x, and I didn't encounter the problem. Once I edited the node alias the second time, the homepage just said page not found. I disabled the path_redirect module and I got the same result. I'm marking this as fixed for now. If you still encounter the problem using the latest version of path_redirect please re-open the issue.

#6

System Message - February 11, 2009 - 01:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.