WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] I would love a clean URL path for uploaded files (12 posts)

  1. whimsy
    Member
    Posted 3 years ago #

    I love that WordPress gives us a full range of wonderful permalink and page structure URLs so we can make them look clean and friendly.

    But when I upload a file, the path isn't clean, and isn't really under my control.

    If I want my blog at my root directory: http://www.example.com/
    But wordpress at http://www.example.com/wordpress

    A file is uploaded to http://www.example.com/wordpress/wp-content/uploads/file

    I have tried to use something like: http://www.example.com/pix/file

    The closest I have got is this: http://www.example.com/wordpress/../pix/file

    That is ugly!

    I could re-design my site to install /wordpress/ as my html root directory, but it would be nice to separate this out more cleanly--after all, uploaded content really could/should be someplace other than theme/plugin content--they aren't used the same way or sometimes even by the same person.

    (If somebody else already asked for this, my apologies--I can't figure out how to search this forum well enough to see it)

  2. esmi
    Forum Moderator
    Posted 3 years ago #

  3. whimsy
    Member
    Posted 3 years ago #

    I guess what I really mean to say is this:

    The upload path always uses the wordpress install path as a base.

    I would like it to use the blog path as a base instead.

    There doesn't seem to be a way to do this. (For some reason I cannot access the codex right now....odd network outage or something, so perhaps I'm missing something, but I've read those docs on wordpress install directories and used them for years)

  4. nakedczechs
    Member
    Posted 3 years ago #

    wp-admin/options-media.php

    Store uploads in this folder

    if you change this setting
    to "pix" it doesn't end up with domain.com/pix/fileshere ?

  5. whimsy
    Member
    Posted 3 years ago #

    What I was trying to do was have my files appear in a location like this:

    http://example.com/pix/file

    My (relevant) blog settings are as follows...
    Main options:
    WordPress address (URL) http://example.com/wordpress
    Site address (URL) http://exmaple.com/
    Media Options:
    Store uploads in this folder: pix

    Resulting file upload URL:
    http://example.com/wordpress/pix/file

    The closest hack I can do to get what I want is this change:
    Media Options:
    Store uploads in this folder: ../pix

    Actual file upload URL:
    http://example.com/wordpress/../pix/file
    (as it appears in the browser's html)
    If I type in the browser my desired URL it goes to the same place.

    I'm posting here in this forum as a request to change WordPress--I'm 99.9% sure it won't do what I want as is.

  6. nakedczechs
    Member
    Posted 3 years ago #

    ahhh, I see you are running 2 different 'sites' per se
    I didn't realize that
    I'm not sure if you can expect wordpress to place content in a place that really isn't part of the 'wordpress site'
    I don't know how extensive your blog is but wordpress does have an option to have a static page as the first page for your site...probably not something that would help you

    have you tried configuring "Full URL path to files" ? -also in the media options

  7. Given that I once moved mine from /wp-content/uploads to /content/sitename/uploads I know it can be done.

    I wish I knew why they seem to think you have to make the path relative, though, that's silly!

    Store uploads in this folder
    /public_html/www/pix

    Full URL path to files
    http://example.com/pix

    And you're done. Obviously you have to know the absolute path of your folders. Mine worked fine with /public_html/www/blah, but you may need to go one up to /home/ipstenu/public_html/www....

    I'm gonna fix the codex now!

  8. whimsy
    Member
    Posted 3 years ago #

    I'm not really trying to run two 'sites' here. I was just trying to keep the WordPress administrative stuff out of my site's root directory.

    I guess I could do it by moving my wp-content directory to be my site root. (While leaving the rest of the WordPress directory structure as it is)

    But I would really like some way of making the file upload path be relative to my WordPress blog directory instead.

  9. nakedczechs
    Member
    Posted 3 years ago #

    have you tried configuring "Full URL path to files" ? -also in the media options

  10. whimsy
    Member
    Posted 3 years ago #

    Ahh...if full paths work fine, I should be able to do what I want afterall. (WP never ceases to amaze me with how versatile it is!)

    I'll have to go and see how it works for me.

  11. That's what I said.

    Store uploads in this folder
    /public_html/www/pix

    Full URL path to files
    http://example.com/pix

    Or where ever you want it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.