- 0
.htaccess for missing images with wildcards
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By Talys · Posted
I am not a fan of haptic feedback touchpads. I've owned a Surface Laptop 7 (Snapdragon) with one and a Lenovo Slim (Intel), and I hated both to the point where I purchased different laptops. It's not that they don't work most of the time; it's that they don't work 100% of the time, and there is no advantage from a user's perspective over a good mechanical trackpad like what's on a ThinkPad X1 or a Yoga 9i. I do not believe that I'll buy another haptic feedback touchpad laptop again in the near future. -
By eiffel_g · Posted
Works fine here too. About this build, I don't like to download any kind of Windows, from any site except Microsoft. The mod might work, but I don't know what it's inside. Can contain malware, backdoors... Long time ago I've used something like this but reversed - it was 98se with the look and some functionality of XP. Or, later XP with Vista look. But I made it myself. Not downloaded from obscure sites. -
By sphbecker · Posted
I didn't have this one on my bingo card. -
By LoneWolfSL · Posted
Rockstar gives last-gen GTA V players free upgrades tomorrow by Pulasthi Ariyasinghe Rockstar is preparing to launch Grand Theft Auto VI later this year, but ahead of that, the company has revealed a new offer for some Grand Theft Auto V owners. It today announced that Xbox One and PlayStation 4 version owners of the 2013-released title will soon be receiving a free upgrade to the current generation version. The studio released the Xbox Series X|S and PlayStation 5 version of Grand Theft Auto V back in 2022, bringing significant upgrades to the original console editions. This included 60 FPS gameplay at up to 4K resolution, as well as major upgrades to textures, draw distance, and audio. Faster load times, ray tracing elements, and HDR support were also added with it. While this new and enhanced version needed a new purchase of the game to jump in, now Rockstar has decided to make it a free upgrade, dropping the $40 price tag entirely on consoles. "Beginning tomorrow, those who own any PS4 version or the digital Xbox One version of Grand Theft Auto V will be able to upgrade to the PS5 or Xbox Series X|S versions at no additional cost, and experience the best versions of GTA V and GTA Online," said the company in an official blog post. The free upgrade offer will be released tomorrow, June 18, for all Xbox One and PlayStation 4 owners of Grand Theft Auto V. Players who will be jumping in on the offer will want to check how to migrate their GTA Online profile from last-generation to current-generation consoles by heading over here. The offer lands ahead of The Kortz Center Heist hitting Grand Theft Auto Online, where players and crews will be tasked with stealing priceless international art from a prestigious gallery in Pacific Bluffs. It doesn't look like Rockstar plans to stop updating its previous game even with Grand Theft Auto VI being on the horizon. The latest title is slated to launch on November 19, 2026, across Xbox Series X|S and PlayStation 5. -
By +Sledge · Posted
Now comes with a money back guarantee instead of a replacement! Hah
-
-
Recent Achievements
-
Vincian earned a badge
One Month Later
-
Jocimo earned a badge
First Post
-
suprememobiles48 earned a badge
Week One Done
-
Windows Guy earned a badge
One Month Later
-
Prasann earned a badge
One Month Later
-
-
Popular Contributors
-
Tell a friend
Question
Brian Miller
I have a folder full of product images. And the image file name is something akin to:
/images/product_15_small.jpg /images/product_15_large.jpg /images/product_201_small.jpg /images/product_201_large.jpg /images/product_47502_small.jpg /images/product_47502_large.jpgIf there is an error in the upload process and one of the files doesn't get created, say "/images/product_201_large.jpg", I'd like Apache to replace that file with this file: "/images/missing_0_large.jpg". And in the case of the smaller image, I want it to be replaced with: "/images/missing_0_small.jpg".
I'm not sure how to do conditional RedirectMatch using HT access and a wildcard. Could someone guide me? Here are the rules that I've tried to experiment with but none of them worked:
#TEST 1: RedirectMatch 404 ^images/product_(\d+)_small.jpg images/missing_(\d+)_small.jpg RedirectMatch 404 ^images/product_(\d+)_large.jpg images/missing_(\d+)_large.jpg #TEST 2: RewriteRule ^images/product_(\d+)_small.jpg images/missing_(\d+)_small.jpg [L] RewriteRule ^images/product_(\d+)_large.jpg images/missing_(\d+)_large.jpg [L]From the example above, "TEST 1" doesn't work however it seems to be the most logical format.
"TEST 2" does work, but it always redirects, and I want it to only redirect when the target file is missing (during a 404).
Please can an Apache expert help me?
Link to comment
https://www.neowin.net/forum/topic/1405828-htaccess-for-missing-images-with-wildcards/Share on other sites
6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now