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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:31:41+00:00 2026-06-04T04:31:41+00:00

I havn’t found any solution to this searching the web. I have a site

  • 0

I havn’t found any solution to this searching the web.

I have a site (call it example.com) which hosts images stored in example.com/images/.

I want to let users get to the image at example.com/images/imagename.jpg by going to the adress example.com/imagename.

Imagenames consists of a-z, A-Z, 0-9, – and _.

Appreciate any solutions!

  • 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-04T04:31:42+00:00Added an answer on June 4, 2026 at 4:31 am

    In the main Apache config (not .htaccess):

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{DOCUMENT_ROOT}/images/%{REQUEST_URI}.jpg -f
    RewriteRule ^/([a-zA-Z0-9_-]+)$ /images/$1.jpg
    

    That says “if the pattern matches the required format then if the path isn’t a file, and if the path isn’t a directory, and if there is a file in the images folder under the document root that has ‘.jpg’ appended then do the redirect”.

    If you’re doing it in .htaccess then you should just be able to replace:

    RewriteRule ^/([a-zA-Z0-9_-]+)$ /images/$1.jpg
    

    with

    RewriteRule ^([a-zA-Z0-9_-]+)$ /images/$1.jpg
    

    but I’ve not had a chance to test it (I have a virtual private server and don’t enable .htaccess, because I’m the only one managing it and it reduces overheads on requests)

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

Sidebar

Related Questions

How on earth do you encode HTML with jQuery/JavaScript? Havn't found any working solution
I have a very quick question to which I havn't found an answer for.
Lots available on this subject but I havn't found anything that answers my question...
Perhaps this is a duplicate question, but I havn't found something by myself. Basically
There's a bunch on this topic, but I havn't found an instance that applies
Doing a german site, and have a JS alert to say you havn't completed
I've been searching for answers, but unfortunately still havn't found one the right one..
I have a issue I havn't yet been able to find a solution on.
I havn't been able to find an answer to this, and it may very
I havn't been able to find the answer to this, and I hope theres

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.