Jump to content

rootPath appears in URL structure on live server


domwilliams
 Share

Recommended Posts

I am using ProcessWire for the first time, having developed a site locally using MAMP and have now moved it to my live server (Linux/123 Reg).

ProcessWire functions as normal on the live environment, access to the control panel works and the pages render correctly.

However, on both the public URL structure (links/asset paths etc) generated by PW, and the control panel URLS for some reason I get the server $rootPath as part of the URL.....

Returned in URL structure: http://www.domain.com/websites/123reg/LinuxPackage24/el/em/en/domain.com/public_html/processwire/page/

The rootPath: /websites/123reg/LinuxPackage21/el/em/en/domain.com/public_html

This appears in my nav links and on assets (images/styles).

Any ideas why this has happened?

Thanks for a great product.

Dom

Link to comment
Share on other sites

Dom, that's not something I've seen before. I'm wondering if there's something about the server environment that is causing it to pick up the wrong url/path. Can you try placing the following into one of your templates, view a page using it, and let me know what it says:

<?php
echo "<p>PHP version: " . phpversion() . "</p>";
echo "<p>rootURL: {$config->urls->root}</p>";
echo "<p>SCRIPT_NAME: $_SERVER[sCRIPT_NAME]</p>";
echo "<p>SCRIPT_FILENAME: $_SERVER[sCRIPT_FILENAME]</p>";
Link to comment
Share on other sites

Those are the expected values there. That makes it more of a mystery because it looks like ProcessWire isn't having any issues getting the proper values from your server (there's no issue with the server environment). What you are seeing in your output is the value of $config->paths->root rather than $config->urls->root. My best guess is that something, somewhere is setting $config->urls = $config->paths (or at least, $config->urls->root = $config->paths->root). Since we haven't seen this elsewhere before, I'm wondering if there might be something in your site that's reassigning that $config var, perhaps a module. One way to test is to install a new stock installation somewhere else on the same server and see if it produces the same result. If it doesn't, then we have to look at what's different with your site.

Also, I'm assuming that this breaks all of the links. If it was substituting the server's disk path for the URL, then everything would lead to a 404. But just want to confirm? If the links aren't broken, then we're very likely dealing with some server or browser "feature" that is trying to translate URLs to paths... but I've not heard of such a thing.

Link to comment
Share on other sites

I got your PM and tried out the site. Definitely something strange going on, because all those URLs with the server path in it should be resulting in 404s, yet they aren't. Do you have any other modules installed other than the default ones that come with PW? Would you mind installing a new/stock copy of PW in another directory on the server, just to see if it behaves in the same manner? That will at least tell us whether we need to look more at the server and your site profile, or if we have new situation that is triggering a yet unknown bug in the core.

Link to comment
Share on other sites

Thanks Dom, let me know what you find. If it's still doing that on a stock installation, and you don't mind giving me temporary SSH or FTP access, I expect I should be able to find a solution quickly. Though we'll find what's going on either way.

Link to comment
Share on other sites

  • 2 years later...

Hey Nico,

I made a couple changes to the head.inc file:
 
"$child->url" changed to "$child->path"
"$config->urls->root" changed to "$homepage->path"
 
and that seemed to fix it… 
 
Then when I then removed  # RewriteBase /pw/ it stopped working… should that happen?
 
 
The site is live www.glossservice.com
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...