Creating Static Images via WordPress Upload (5 posts)

  1. Neil Guevara
    Posted 7 years ago #

    I was wondering if it would be possible to create static Images via the wordpress upload function. Static Images are images with the img. tag at the start of the URL.

    WordPress upload URL's typically look like this : http://example.com/wp-content/uploads/img_22 for example but what i would like to create is a http://img.example.com/img_22 URL. This way images are more stable and can take a lot more hits.

    On any dedicated server you can trick a site into thinking the images are static by creating a subdomain img.example.com and then upload images there. When you click on the image it will be img.example.com/img_22 as that is where it is and the URL will direct to the static server, but with wordpress you cant do this.

    Usually i would add the location to the subdomain but with wordpress it will not upload. Im wondering if there is a hack for this, to set the uploasd path to a subdomain?

    cheers guys!

  2. Covi
    Posted 7 years ago #

    Ummm... so easy as?:

    1. Using a new subdomain (virtual or not):
    Now, you can uses this phisical directory or rewritte to wp-content/themes/your theme folder images:
    2a. Create a folder for this subdomain.
    3a. Moving your resources (in the example: images) to new folder.

    2b. Using rewritte (mod_rewritte apache...).
    3b. In your config of subdomain (via .htaccess, php.ini...), something as (f.e: the same code of WordPress):

    RewriteEngine On
    RewriteBase /subdomain folder/ or subdomain
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/wp-content/themes/your theme/images folder/ [L]

    Check this but I think it should be works fine ;)

  3. Look close at the Options->Miscellaneous screen. You can make the media URL anything you like. Setting up the subdomain to point to the right directory is your own problem though.

  4. Neil Guevara
    Posted 7 years ago #

    yeah but how do i get it to point to the sub-domain. thats basically my question.

  5. Geph
    Posted 6 years ago #

    Thanks! This helped a lot.

Topic Closed

This topic has been closed to new replies.

About this Topic