WordPress upload attachments to root

I have a wordpress site and I want to upload a PDF file so I can have an URL like this:

 http://www.mydomain.com/attachment.pdf

But how can I achieve this? Because when I upload the file via Media in de wordpress administration panel it has an URL like this:

Read More
 http://www.mydomain.com/wp-content/uploads/attachment.pdf

But I don’t need the “wp-content/uploads” stuff in my URL.

I also tried to upload the file with an Ftp upload on to the root but when I want to go to that URL it says “page not found”

any ideas?

Related posts

Leave a Reply

3 comments

  1. You change the upload location by adding following line in your wp-config.php

    define( 'UPLOADS', '/blog/wp-content/uploads' );
    

    By adding this line the image url would be somewhat like this

    http://localhost/wordpress/blog/wp-content/uploads/2013/09/btn2.png/btn3.png
    

    If you try and remove the blog/content/uploads then also the year and date remains

    For that Go to Settings and media and uncheck the organsize media option..

    Hope it works for you ..

    Note: This Steps are not for beginners. Use it only if you know what you are doing.

  2. If you’re hosting your WordPress site on a machine you can SSH into:

    1. You can verify the file you uploaded through FTP is in the right place (and move it to the right place if it’s not)
    2. You can move the file uploaded through WordPress to the right place

    To be available at http://www.example.com/attachment.pdf the file has to be in the same directory as the index.php file, wp-settings.php file, wp-admin folder, etc.

    You can log into the remote machine with SSH and use Bash commands (especially ls and mv) to view and move files.