Problem with paths (huge redirect issues)

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Hare
Forum Members
Forum Members
Posts: 87
Joined: Sat Jun 03, 2006 11:46 am

Re: Problem with paths (huge redirect issues)

Post by Hare »

calguy1000 wrote: I'm still thinking you've got a mod_rewrite or a mod_security issue.
I called my host last week and the morons haven't called back. I would change the host but the site owner refuses to do so.

Any ideas how to debug this further? Any ideas why the tinyMCE path is incorrect. I'm sure that's not a redirect etc issue...

I have debug mode on and if I submit a news I get this bad URI.

Code: Select all

http://www.domain.com/moduleinterface.php?mact=News,m1_,defaultadmin,0&m1_tab_message=articleupdated&m1_active_tab=articles
the admin path is just missing.
Last edited by Hare on Sun Sep 02, 2007 3:19 pm, edited 1 time in total.
alby

Re: Problem with paths (huge redirect issues)

Post by alby »

calguy1000 wrote: I'm still thinking you've got a mod_rewrite or a mod_security issue.
Hare has a Sun One server and I don't think that Sun One has mod_*

But

Hare wrote: this is what my tinymce path looks like in the admin pages:

Code: Select all

<__script__ type="text/javascript" src="http://www.domain.com/test/modules/TinyMCE/tinyconfig.php"></__script>
it should be ...com/test/admin/modules...
it's correct, TinyMCE live under /modules

Hare wrote: I have no idea why CMSMS misses the admin directory. Any ideas if there is a single location where I could hard code the admin path?
admin directory is in config.php only

Alby
Hare
Forum Members
Forum Members
Posts: 87
Joined: Sat Jun 03, 2006 11:46 am

Re: Problem with paths (huge redirect issues)

Post by Hare »

alby wrote: it's correct, TinyMCE live under /modules
You are right. I'm a bit mixed up as I've been debugging this for ages now. Anyway, the tinymce doesn't work. No idea why, but it just doesn't work. On my apache installation it works just fine.

For some reason the title in the admin section is also broken it just displays "sitename - " and that's it. There should be the section name after the site name but it's not there.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Problem with paths (huge redirect issues)

Post by calguy1000 »

I wouldn't look at CMS as the main culprit here.  I'd look at the SunOne server (which is a derivative of other servers, I just can't remember which). 
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Hare
Forum Members
Forum Members
Posts: 87
Joined: Sat Jun 03, 2006 11:46 am

Re: Problem with paths (huge redirect issues)

Post by Hare »

Culprit or not I really need to get this working.

Here's another redirect example. If I click the logout link in the admin frontpage. It goes to the correct page
http://www.domain.com/test/admin/logout.php BUT

that page has a redirect:

Code: Select all

redirect("login.php");
For some reason what comes out of the redirect function is this:

Code: Select all

http://www.domain.com/login.php
it should be

Code: Select all

http://www.domain.com/test/admin/login.php
Another redirect problems appears when I try to login. I have debug mode on and when I have entered my login details and pressed submit I get the debug page and there's no redirect url at all.

... And I just can't imagine what could cause the problem with page titles, tinymce etc.
Last edited by Hare on Sun Sep 02, 2007 3:51 pm, edited 1 time in total.
alby

Re: Problem with paths (huge redirect issues)

Post by alby »

Hare wrote: that page has a redicect:

Code: Select all

redirect("login.php");
For some reason what comes out of the redirect function is this:

Code: Select all

http://www.domain.com/login.php
it should be

Code: Select all

http://www.domain.com/test/admin/login.php
??? , maybe you have a path problem

UNTESTED and DIRTY, but try to add in admin/index.php:
$_mycurrentpath = getcwd();
$_myincludepath = ini_get('include_path');
ini_set = ('include_path', $_mycurrentpath.':'.$_myincludepath);

Alby
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Problem with paths (huge redirect issues)

Post by calguy1000 »

Yep, looks like the web server is doing redirects on you.

After some quick google searches, the SunOne webserver does have redirection stuff built in (it's like mod_rewrite).  So I'd check that.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Hare
Forum Members
Forum Members
Posts: 87
Joined: Sat Jun 03, 2006 11:46 am

Re: Problem with paths (huge redirect issues)

Post by Hare »

Huge thanks to you guys for your time.

@Alby. Didn't work. Now when I press logout it still goes to http://www.domain.com/login.php

It should be
http://www.domain.com/test/admin/login.php

@calguy1000. I'm not sure what makes you think it's a redirection issue. If the redirect function is outputting the wrong URL I can't see how the server environment could touch the URL when the redirection hasn't yet happened. The target URL is bad immediately as it comes out of the redirect function.
Last edited by Hare on Sun Sep 02, 2007 4:22 pm, edited 1 time in total.
Hare
Forum Members
Forum Members
Posts: 87
Joined: Sat Jun 03, 2006 11:46 am

Re: Problem with paths (huge redirect issues)

Post by Hare »

@Alby

Code: Select all

$_mycurrentpath = getcwd();
$_myincludepath = ini_get('include_path');
ini_set('include_path', $_mycurrentpath.':'.$_myincludepath);

echo "current: $mycurrentpath - include: $myincludepath";
Hmm. The echo is just "current: - include:"
alby

Re: Problem with paths (huge redirect issues)

Post by alby »

Code: Select all

[quote="Hare"]
@Alby
[code]
$_mycurrentpath = getcwd();
$_myincludepath = ini_get('include_path');
ini_set('include_path', $_mycurrentpath.':'.$_myincludepath);

echo "current: $mycurrentpath - include: $myincludepath";
Hmm. The echo is just "current: - include:"
[/quote]

Attention to underscore (for avoid name collision)
echo "current: $_mycurrentpath - include: $_myincludepath";[/code]

Try with:

Code: Select all

$_mycurrentpath = getcwd();
$_myincludepath = ini_get('include_path');
ini_set('include_path', $_mycurrentpath.':'.$_myincludepath);
$_newincludepath = ini_get('include_path');

echo "Current path: $_mycurrentpath<br />";
echo "Old includepath: $_myincludepath<br />";
echo "New includepath: $_newincludepath<br />";
Alby
Hare
Forum Members
Forum Members
Posts: 87
Joined: Sat Jun 03, 2006 11:46 am

Re: Problem with paths (huge redirect issues)

Post by Hare »

Ok. I tried with your code clip:

Code: Select all

Current path: /data/iweb/storage/domain/data/test/admin
Old includepath: .
New includepath: /data/iweb/storage/domain/data/test/admin:.
Didn't help. If I submit a news I'm redirected to

Code: Select all

Debug is on. Redirecting disabled... Please click this link to continue.
http://www.domain.com/moduleinterface.php?mact=News,m1_,defaultadmin,0&m1_tab_message=articleupdated&m1_active_tab=articles
The "admin" directory is missing.

Btw. I have no idea why the page title doesn't work. There are many weird things happening. I checked the sourcecode but didn't find anything wrong. Maybe the system just can't find some file to include or something.

Maybe some paths are hard coded so these hacks don't work?
Last edited by Hare on Sun Sep 02, 2007 8:17 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Problem with paths (huge redirect issues)

Post by calguy1000 »

Looking at the code to the redirect function in lib/misc.functions.php

I would add a debug statement in one of the admin files somewhere that dumps out the value of $_SERVER['PHP_SELF']
and see what it says.

also, dump out the value of $_SERVER['REQUEST_URI'];

and then after that, do a global dump of everything in $_SERVER.  i.e:
print_r( $_SERVER );

sepearate everything with prompts, and/or statements so that you can tell which is which
and post what you get.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Hare
Forum Members
Forum Members
Posts: 87
Joined: Sat Jun 03, 2006 11:46 am

Re: Problem with paths (huge redirect issues)

Post by Hare »

calguy1000 wrote: Looking at the code to the redirect function in lib/misc.functions.php

I would add a debug statement in one of the admin files somewhere that dumps out the value of $_SERVER['PHP_SELF']
and see what it says.

also, dump out the value of $_SERVER['REQUEST_URI'];

and then after that, do a global dump of everything in $_SERVER.  i.e:
print_r( $_SERVER );

sepearate everything with prompts, and/or statements so that you can tell which is which
and post what you get.
Here's print_r($_SERVER);

Code: Select all

Array
(
    [HTTP_HOST] => www.domain.com
    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows; U; Windows NT 6.0; fi; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
    [HTTP_ACCEPT] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    [HTTP_ACCEPT_LANGUAGE] => fi,en;q=0.5
    [HTTP_ACCEPT_ENCODING] => gzip,deflate
    [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
    [HTTP_KEEP_ALIVE] => 300
    [HTTP_CONNECTION] => keep-alive
    [HTTP_REDIRECT_STATUS] => 200
    [PATH] => /opt/iweb/webserver/bin/https/bin:/usr/sbin:/usr/bin:/bin:/usr/bin
    [TZ] => EET
    [LD_LIBRARY_PATH] => /usr/lib/lwp:/opt/iweb/webserver/bin/https/lib:/jre/lib/sparc/server:/jre/lib/sparc:/jre/lib/sparc/native_threads::/usr/lib/mps/secv1:/usr/lib/mps:/usr/lib/mps/sasl2:/opt/openldap/lib
    [SERVER_SOFTWARE] => Sun ONE Web Server/6.1
    [SERVER_PORT] => 80
    [SERVER_NAME] => www.domain.com
    [SERVER_URL] => http://www.domain.com
    [REMOTE_HOST] => XXX.XXX.XXX.XXX
    [REMOTE_ADDR] => XXX.XXX.XXX.XXX
    [REDIRECT_STATUS] => 200
    [HTTPS] => OFF
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [SCRIPT_NAME] => 
    [PATH_INFO] => /test/redirect.php
    [PATH_TRANSLATED] => /data/iweb/storage/NAMECHANGED/data/test/redirect.php
    [PHPRC] => /config/php/www.pl
    [PHP_SELF] => /test/redirect.php
    [argv] => Array
        (
        )

    [argc] => 0
)
php_self as you can see /test/redirect.php (nevermind the filename, it's just the name of the test script.
request_uri is not set so the variable does not exist. This was from a separate debug file. I'll try adding the same stuff to admin/index.php but I doubt it would be any different.
Post Reply

Return to “CMSMS Core”