Jump to content

Recommended Posts

Posted

Hi Guys, 

I wanted to post this thread to get some insight as to how others are migrating from a staging directory inside a live server to the actual root directory.

I typically develop a project locally using Mamp and then move into a staging environment on a staging server . There are some cases the project requires to move the site into a directory inside a live site to make deployment of the new project move faster.

When I move a project into a directory on the live server of domain.com/test/ I run into an issue of content links.

What I mean is that I look at the source code in the CKEDITOR for a field and the link will display:

 domain.com/test/whatever-the-link-is/ 

or 

domain.com/test/assets/file.pdf

or

domain.com/test/assets/image.jpg 

 

The issue is, when I move to a live site, I have to go back and change tons of links from:

domain.com/test/whatever-the-link-is/

to 

domain.com/whatever-the-link-is/  

 

How are you guys making the link changes across the entire site at once?

Are you using SQL Commands? Something in ProcessWire?  Any suggestions will help eliminate the manual process. :-)

Posted

I've always used a subdomain instead of a directory. You don't get the added path problems. The times I have had to work out of a subdirectory I've used something like phpmyadmin or adminer to change the links before shifting everything over.

  • Like 1
Posted

@Marty Walker Right, I do the same, however in some instances, the only option is a directory. The actual live site is in a directory, therefore the director name will need to change across the entire site. I just hate having to manually change every link. 

Posted

At least for links to pages, you can enable the builtin link abstraction feature that came with PW 3.0.6. I haven't used it myself (wrote my own link abstraction shortly before 3.0.6 came out and mine ties into other modules/workflows I use), but from what I saw in the code, it should deal with any path changes on its own. You're left to handle images yourself though (I think).

  • Like 1
Posted
2 hours ago, quickjeff said:

What I mean is that I look at the source code in the CKEDITOR for a field and the link will display:

 domain.com/test/whatever-the-link-is/ 

For me, all internal links made in a CKEditor field are relative links, and these wouldn't need to be updated if the site was moved to a subdirectory. Not sure why you would be getting absolute links in yours.

There is a config setting for ProcessPageEditLink to set the URL type:

page-link.png

Strangely, mine is set to "Absolute", but maybe this means "absolute relative to the site root"?

Posted
7 hours ago, Robin S said:

Strangely, mine is set to "Absolute", but maybe this means "absolute relative to the site root"?

It's relative to the domain root, as far as I know. Have never actually tested in subdomain scenarios.

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
×
×
  • Create New...