1

How can I change the image url from this

http://i0.wp.com/example.com/wp-content/uploads/2014/06/imagename

Into this:

http://www.example.com/image/imagename.jpg

Or into this:

http://www.example.com/imagename.jpg

Any suggestions to to solve this problem?

  • 2
    It looks like you're using the Photon service from wordpress.org. So to get rid of the http://i0.wp.com/ part, you would need to turn it off in you JetPack plugin. Are these cosmetic changes only or needed for something else? – birgire Jun 23 '14 at 9:12
  • Needed for something else. It is possible to make it as www.example.com/nameofimage.jpg instead of this i0.wp.com/example.com/wp-content/uploads/imagename? – Yang Jun 23 '14 at 9:22
  • 'Something else', can you expand on that? As @birgire explained, it is impossible while using a CDN service such as Jetpacks Photon service – Tom J Nowell Jun 23 '14 at 9:25
  • I've disabled already the jetpacks. How it possible to make this kind of url for medias -> www.example.com/mediasname – Yang Jun 23 '14 at 9:29
4

Go into your WordPress Dashboard > Settings > Media and then untick the option that says

Organize my folders into Month and Year based folders

This will make it look like:

http://example.com/wp-content/uploads/imagename.jpg

Then to take it further you need to update you config.php file and add in either this line:

define( 'UPLOADS', 'image/'.'files' ); 

This will give you:

http://www.example.com/image/imagename.jpg

Or this:

define( 'UPLOADS', ''.'files' );

...to get:

http://www.example.com/imagename.jpg

| improve this answer | |
  • In my parent theme files? Or one of this /public_html/wp-config.php /public_html/wp-admin/setup-config.php /public_html/core_20140602-050214/wp-config.php /public_html/core_20140602-050214/wp-admin/setup-config.php /public_html/wp-content_stock/plugins/akismet/views/config.php /public_html/wp-content/plugins/akismet/views/config.php – Yang Jun 24 '14 at 1:35
  • Your wp-config.php file will normally be in the root directory you installed WordPress. You will see within the directory, the wp-content, wp-admin and wp-includes folders. So in your case This will be the correct one. > /public_html/wp-config.php – Matt Royal Jun 24 '14 at 6:59

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