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

  • Home
  • SEARCH
  • 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 471007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:56:33+00:00 2026-05-12T23:56:33+00:00

I recently moved a files/images folder on my site (a Drupal installation) from /sites/default/files/

  • 0

I recently moved a files/images folder on my site (a Drupal installation) from /sites/default/files/ to /sites/example.com/files/, but there are now a lot of 301 errors from external hotlinking sources, and I’d like to redirect inbound links from the old ‘default’ path to the new ‘example . com’ path, but only for this one domain…

Basically, I’d like to redirect visitors from the following:

example dot com /sites/default/files/*

to:

example dot com /sites/example.com/files/*

While allowing visitors from other domains (e.g. example2 dot com) to still see sites/default/files.

(Sorry for all the weird dot com and spacing, I’m only allowed to post a maximum of one ‘hyperlink’ – perhaps Stack Overflow should consider allowing example dot com as many times as needed).

  • 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-12T23:56:34+00:00Added an answer on May 12, 2026 at 11:56 pm

    Try this mod_rewrite rule:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} =example.com
    RewriteRule ^sites/default/files/(.*) /sites/example.com/files/$1 [L,R=301]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently moved my website to a shared hosting solution at asmallorange.com , but
I've recently moved from VB6 to VB.NET and I am finally getting there with
I recently moved my WordPress site from my Mac OS X to Windows XP
I recently moved a wordpress site from media temple's gs to their dedicated virtual
I recently moved my asp.net appliaction from windows 2003 / IIS 6 to windows
I recently moved a friends blog onto his new web hosts but unfortunately the
I've recently moved to Java, but I've had some problems with variable aliasing. I've
I've recently moved my project from sourceforge to Google code. I'm intrigued by the
We have recently moved some data from an SQL Database instance to another one
I've recently moved from an SVN shop to a place that uses TFS. In

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.