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 8895025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:39:48+00:00 2026-06-14T23:39:48+00:00

How can I load requested file from another directory (using .htaccess ) if that

  • 0

How can I load requested file from another directory (using .htaccess) if that file is not found at the requested URL?

For example:

Request:: mysite.com/samples/image_requested.jpg (does not exist)

Output: mysite.com/samples/missing/image_requested.jpg (without showing the exact url in the browser)

I tried this but it gives me a 500 Internal Error:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/samples/
RewriteCond %{REQUEST_URI} !^/samples/missing/
RewriteRule ^samples/(.+)$ /samples/missing/$1
  • 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-06-14T23:39:49+00:00Added an answer on June 14, 2026 at 11:39 pm

    Here is an example for jpg, png and gif files. It will display always the requested URL (/samples/file.jpg), not the real one (/samples/missing/file.jpg):

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule samples/(.*\.(jpg|png|gif)) samples/missing/$1 [L] 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can i send the request to load certain div with a url only something
I know we can load a Object from .class file and my question is
Apache Pig can load data from Hadoop sequence files using the PiggyBank SequenceFileLoader :
Struggling to load json from file (myData.json) on URL into an object so I
I can load the Color contents of the Current Window using GetDIBits but i
I can load COM DLLs that are registered on my machine like this: Type
I have a web application that can load plugins through reflection. It currently uses
If I load an HTML from file:// and in the HTML there's an AJAX
server: apache http server 2.2 problem: code does not load my text file hello
I am successfully loading via AJAX some svg from external file: $(#svg).load(svgUrl + svg,

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.