Viewing 2 replies - 1 through 2 (of 2 total)
  • Example: define( ‘UPLOADS’, ‘wp-content/uploads’ );

    You are putting it at the root instead of under a folder? Why do you want to move the uploads folder? // in programming is usually how you display a / in a string or is the return of an empty value.

    Thread Starter songee

    (@songee)

    By default, WordPress will put media uploads under https://website.com/wp-content/uploads/

    I’d like a shorter URL because the wp-content part in the URL is pretty useless from the users point of view.

    With the define( 'UPLOADS', 'files' ); line in the wp-config.php, WordPress puts media uploads under https://website.com/files/

    This is the behavior I want. However, the URLs of the uploads have an additional forwards slash added to them, which is undesirable, eg.: https://website.com/files//img.png

    I’ve Googled some and changed this line:
    define( 'UPLOADS', 'files' );
    to
    define( 'UPLOADS', ''.'files' );

    And the extra forward slash from the URLs appears to be gone. URLs are now correct, eg.: https://website.com/files/img.png

    I’m not sure why or how it works. Would be really nice if someone knowledgeable could confirm if this is indeed the correct and reliable fix for this issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Double forward slashes after defining UPLOADS in wp-config.php’ is closed to new replies.