Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3941566
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:33:30+00:00 2026-05-20T00:33:30+00:00

These paths break when I upload my media directory to S3. Here’s my process:

  • 0

These paths break when I upload my media directory to S3.

Here’s my process:

I have a script that uploads my entire media directory to Amazon S3 CDN.
So my website downloads images/css/js from that CDN.

But, a lot of my plugins from JQuery have images that are “relatively” defined.
So when it puts to S3, that path doesn’t make sense anymore.

What do I do in this case?
I really want to put my media folder in S3, but I just wish the paths can be kept.

Example:

/media/js/fancybox/fancybox.js 
/media/js/fancybox/fancybox-image.png

When I run this in my Apache/Django server, it works, since fancybox.js calls the fancybox-image.js, and it detects it.

However, when I run it on my Amazon S3:

s3.amazon.com/my_bucket/js/fancybox/fancybox.js
s3.amazon.com/my_bucket/js/fancybox/fancybox-image.png

The javascript calls this image instead:

s3.amazon.com/my_bucket/fancybox-image.png
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:33:30+00:00Added an answer on May 20, 2026 at 12:33 am

    Define a URLbase variable in your JS so that in your development environment it’s something like URLbase = "http://localhost" and on production it’s URLbase = "http://s3.amazon.com/my_bucket"

    Then when you’re defining URLs you can prepend URLbase to the location, or define a utility function that will prepend the URLbase to the path (this would make it more flexible if you’ve got a few base URLs you want to mix in at once.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have no idea. This causes seemingly random time-outs. These in turn break the
I have a script that appends some rows to a table. One of the
I have a model with ImagePath and PDFPath properties. When they click save, that
I have to check if I have duplicate paths in a FileListBox (FileListBox has
I have a Visual Studio 2008 C# Project. Here is what works: It runs
This is beyond both making sense and my control. That being said here is
I currently have a php webpage. However, I want to break it down into
update Here is the situation: I'm working on a website that has no physical
I have a simple java program that runs fine in eclipse but cannot find
Newbie python here. How can I break out of the second while loop if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.