So I recently migrated my site between servers. I think this is causing some issue with the base path of Drupal, which in turn affects the image upload path when a user tries to upload an image to his/her profile.

So, before migrating, some data was already uploaded to some of the users and their images and paths work just fine. The path is as follows for example:


But now, when I'm trying to add new users and when I upload new pictures, the image doesn't get uploaded and the path to the image is as follows:


Why is this happening? How do I change the Drupal base path? Thanks

  • Can you provide your code how you are saving image? Aug 26, 2013 at 12:09
  • I didn't manually write the code for saving the images. Images are saved directly by Drupal.
    – KaushikTD
    Aug 26, 2013 at 12:16
  • Whether or not this solves the problem, you can change the $base_url in sites/default/settings.php
    – Geoff
    May 10, 2014 at 22:36
  • You just need to enable clean urls from admin (admin/config/search/clean-urls). Just check mod_rewrite is enabled on sever
    – user33576
    Aug 22, 2014 at 4:59
  • Are you sure you copied the .htaccess file as well? Jan 15, 2017 at 3:09

2 Answers 2


Firstly, it seems that the new server does not allow clean urls or it needs some configuration. Check the documentation on Drupal.org: Step 6: Configure clean URLs

Then, clean all caches and run cron. You will then see all image paths as /new/sites/sites/default/files/...

That's because the new site is set on folder ROOT/new or am I wrong? So there is no error, you have to set the domain to look at this subfolder.

If you don't have permissions to do this in your hosting or there are no options like Add-On domains you can follow the discussion at Drupal installed in subdirectory but made to appear in root according to your hosting enviiroment.

  • Alright, so I don't have clean URL's enabled. But that shouldn't be an issue right? I mean I don't want cleanURLS enabled anyway.
    – KaushikTD
    Aug 26, 2013 at 12:15
  • NO it is not an issue. Is the new site under ROOT/new folder? Aug 26, 2013 at 12:17
  • Yes you are right. It's under ROOT/new
    – KaushikTD
    Aug 26, 2013 at 12:20
  • I 've edited my answer. Did you find any solution? Aug 26, 2013 at 21:25

First of all mention $base_url = 'http://example.com'; in settings.php file. Then provide permission to your files folder. It should be at sites/default/files

Provide permissions:

cd /var/www/drupal_root/sites/default/
sudo chmod 777 -R files

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.