Forum

Thread tagged as: Question, Configuration, Suggestions

Root relative paths on production server.

Hi, I have a perch site that works fine on local and staging servers.

I'd like to up load the site to my production server and then let the customer access it through it's IP address (1.2.3.4/~mysite/index.php) to make updates. When they are happy, I'd then put in a request to transfer the sites domain from a third party (where their current website is hosted) to my servers. The idea being that the new site would be instantly up and running once the domain has propagated.

However, there is an issue with the root relative links in my perch site. /css/app.css now points to 1.2.3.4/css/app.css instead of 1.2.3.4/~mysite/css/app.css.

Does anyone know of a workaround without me using absolute paths? Cheers!

Ian Rock

Ian Rock 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Yes - point a domain to the server (like a subdomain - staging.mydomain.com) you definitely don't want to work on a tilde path - they are very weird.

I've had this problem also, tilde's are a pain; it tends to happen when: - launching a new site on the production server while the client's existing site is on another server - you want to switch over with minimal downtime - & ideally test on the production server before launch.

I develop locally, test on a staging server (a subdomain of our own cpanel dev account, i.e. client-staging.mydevdomain.com), then move it to the client's new account on the production server, i.e. 1.2.3.4/~clientsite/.

The only way I can see to test a Perch site on the production server prior to launch (i.e. before updating the client domain's A records) is to put it into a separate add-on domain on the client's new account and map a temporary / test domain to that?

But then it's in a sub-directory of the production server root & needs to be moved to root after testing & prior to the A record update anyway, which still leaves a little crossing of fingers at launch time as the site still hasn't been / can't be tested in place.

That said, I just winged it the last time and of course, Perch being Perch, it all just worked: Yay!

Is there a better approach to launching a Perch site?

Thanks guys. That's exactly the same way we work Adam - and the same issues.

Rachel, the main production server doesn't have a dedicated i.p address and I can't change the A records for the sub domain to point to "1.2.3.4/~mysite". :(

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you not just point a new virtual host at the mysite folder?

Possibly Drew, I just cannot figure out how to do that in CPanel / WHM and I do not have ssh access to see the whole of the shared server.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. I think ultimately the solution is to have a good control over how you configure your sites rather than to reshape your workflow to accommodate shortcomings in your hosting.

Is this just a shared hosting limitation then and not one you would encounter with VPS hosting? Not sure what's involved in 'pointing a new virtual host at the mysite folder' !