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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:38:32+00:00 2026-05-31T14:38:32+00:00

Here is what I have for now in my .htaccess and this should work

  • 0

Here is what I have for now in my .htaccess and this should work in future:

RewriteEngine On

RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

The question is:

how can I make this rewrite /tmp/some_image.png -> /image.php?file=some_image.png

I’ve tried to make my own rule, but without success.

Thanks.

  • 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-31T14:38:33+00:00Added an answer on May 31, 2026 at 2:38 pm

    Is /tmp a directory accessible by your web-server? I’m hoping it’s a separate /tmp folder and not the actual /tmp of the server as that would be a security risk.

    Anyway if the image is a physical file then you need to put this after your rewrite to force HTTPS and before the conditions checking if it’s a file or directory:

    RewriteRule ^/tmp/([^\.]+)\.png$   /image.php?file=$1.png [NC,L]
    

    You could check for other extensions as well:

    RewriteRule ^/tmp/([^\.]+)\.(png|jpg|gif)$    /image.php?file=$1.$2 [NC,L]
    

    Or if you don’t care (everything is an image in your tmp folder. Though i wouldn’t recommend this)

    RewriteRule ^/tmp/(.*)$    /image.php?file=$1 [NC,L]
    

    If it’s not a physical file you can put any one of these at the end of your rules.

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

Sidebar

Related Questions

I have this in my .htaccess : RewriteRule ^images/([^/\.]+)/(.+)$ themes/current/images/$1/$2 [NC] RewriteCond %{REQUEST_FILENAME} !-f
i have a site site.com/?w=thisworks site.com/w/thisalsoworksmanually i got this to work via htaccess now
Here is the thing. Right now I have this e-commerce web site where people
I have followed this tutorial here as mentioned exactly I now try to run
I have a directory protected by htaccess. Here is the code I use now:
Good morning. I currently have this little rule in my .htaccess RewriteEngine On RewriteBase
I am dont know mutch about .htaccess. I need help here. I have this
Here's my question. Right now I have a Linux server application (written using C++
I have heard that DateTime.Now is very expensive call (from here ) Is GETDATE()
I have a problem here. Right now I'm doing my Web Based Application, my

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.