Jump to content

Recommended Posts

Posted

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

Posted

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>";
Posted

Thanks so much for looking into this Ryan.

Here is the info you requested:

PHP version: 5.2.16

rootURL: /

SCRIPT_NAME: /index.php

SCRIPT_FILENAME: /websites/123reg/LinuxPackage24/el/em/en/domain.com/public_html/index.php

Posted

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.

Posted

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.

Posted

Thanks for checking it out Ryan. No other modules have been installed, only difference is installing on MAMP and then uploading to live environment.

I will try installing a new stock install and come back to you.

Posted

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.

  • 2 years later...
Posted

For you - it's Nico ;)

There is a file called ".htaccess" in your root folder (the folder PW lays in). In this file you probably have to remove the # next to the "RewriteBase path".

  • Like 1
Posted

You only need to remove one of these, the first one if your ProcessWire installation is not installed to a subdirectory (""http://domain.com/processwire/".

  • Like 1
Posted

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

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
  • Recently Browsing   0 members

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