domwilliams Posted November 20, 2011 Share Posted November 20, 2011 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 More sharing options...
ryan Posted November 21, 2011 Share Posted November 21, 2011 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 More sharing options...
domwilliams Posted November 21, 2011 Author Share Posted November 21, 2011 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 Link to comment Share on other sites More sharing options...
ryan Posted November 21, 2011 Share Posted November 21, 2011 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 More sharing options...
ryan Posted November 21, 2011 Share Posted November 21, 2011 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 More sharing options...
domwilliams Posted November 21, 2011 Author Share Posted November 21, 2011 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. Link to comment Share on other sites More sharing options...
ryan Posted November 21, 2011 Share Posted November 21, 2011 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 More sharing options...
tomrogers Posted June 23, 2014 Share Posted June 23, 2014 I'm having the same problem with a site. Was there ever a solution to this? Would really appreciate any help you might be able to give? Link to comment Share on other sites More sharing options...
Nico Knoll Posted June 23, 2014 Share Posted June 23, 2014 Do you set a RewriteBase in your .htaccess? 1 Link to comment Share on other sites More sharing options...
tomrogers Posted June 23, 2014 Share Posted June 23, 2014 @superhero – No, I don't think I've done that. What does it mean? I'm really new to this – so have no idea what I'm doing to be honest! Link to comment Share on other sites More sharing options...
Nico Knoll Posted June 23, 2014 Share Posted June 23, 2014 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". 1 Link to comment Share on other sites More sharing options...
tomrogers Posted June 23, 2014 Share Posted June 23, 2014 Thanks Nico! So, do I remove the # from all of these # RewriteBase / # RewriteBase /pw/ # RewriteBase /~user/ Link to comment Share on other sites More sharing options...
LostKobrakai Posted June 23, 2014 Share Posted June 23, 2014 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/". 1 Link to comment Share on other sites More sharing options...
tomrogers Posted June 23, 2014 Share Posted June 23, 2014 Awesome, thank you @LostKobrakai Link to comment Share on other sites More sharing options...
Nico Knoll Posted June 23, 2014 Share Posted June 23, 2014 So is it working now? Link to comment Share on other sites More sharing options...
tomrogers Posted June 23, 2014 Share Posted June 23, 2014 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now