WordPress.org

Ready to get started?Download WordPress

Forums

change urls of uploaded pdfs (7 posts)

  1. Bet Hannon
    Member
    Posted 6 months ago #

    I have a multisite install using subdomains, mapped to individual domain names.

    When I upload media from a sub-site with a subbomain of "bizname.maindomain.com" and a mapped domain of "bizname.com", the url assigned to the file is: http://bizname.maindomain.com/wp-content/uploads/sites/40/2014/03/filename.jpg

    The client would like to NOT have the maindomain in the urls of their pdfs, and instead have their own domain name: "bizname.com".

    I've searched the forums, and I see a number of posts of people trying to change the directory location of the upload. I don't want to change the location, just the url, which will look a little more professional and "stand-alone" for the client.

    Is there a way to change the settings so that in urls for media, http://bizname.maindomain.com/wp-content/uploads/sites/40/2014/03/filename.jpg becomes:
    http://bizname.com/wp-content/uploads/sites/40/2014/03/filename.jpg?

    Or even better: http://bizname.com/2014/03/filename.jpg?

    (Just about the time I think I get this uploads in multisite stuff figured out, I realize I haven't...)

  2. Bet Hannon
    Member
    Posted 6 months ago #

    Anybody have an idea about this....?

    Would changing the "Upload Url Path" in the site settings do this?

    And would making the change work retroactively for media uploaded before the change? I'm thinking not...

    I need to figure this out before I start uploading a bunch of media for this client.

  3. You just search/replace the old URLs in the DB.

    Is there a way to change the settings so that in urls for media, http://bizname.maindomain.com/wp-content/uploads/sites/40/2014/03/filename.jpg becomes:
    http://bizname.com/wp-content/uploads/sites/40/2014/03/filename.jpg?

    Literally? Search the wp_x_posts tables for http://bizname.maindomain.com/wp-content/uploads/sites/40 and make it http://bizname.com/wp-content/uploads/sites/40

    Use https://github.com/interconnectit/Search-Replace-DB for it though.

  4. Bet Hannon
    Member
    Posted 6 months ago #

    Yes, that will change the ones that have already been uploaded, but I'm more focused on uploads going forward, since this is a new site.

    I was able to finally test a bit today, and it looks like adding
    http://bizname.com to "Upload url path" (not upload path) will do what I am wanting. I know I shouldn't tweak these settings too much, but I'm wondering if that will cause any problems down the line. Can you think of anything that would get messed up because of that?

  5. Going forward this shouldn't be a problem if you're using a domain mapping plugin, and have the user logging in to bizname.com/wp-admin (and not bizname.maindomain.com). Otherewise my whole halfelf site would be littered with tech.ipstenu.org.... ;)

    If for whatever reason that doesn't happen, you can set "Upload Url Path" and "Fileupload Url" to http://bizname.com/wp-content/uploads (yes, JUST uploads) and that should force it.

  6. Bet Hannon
    Member
    Posted 6 months ago #

    What's the difference between "upload URL path" and "fileupload URL"?

  7. One's the old form, used on older WP instances, one's the new one. They can both be the same without harm.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.