If 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:
Microsoft Edge comes pre-installed with Windows 11 and it's a great browser, so why not use it? Not everyone is trying to run away from Google, sometimes people just want convenience and less friction.
No. The file manager is a lost cause. After all, its dev receives all the undeserved praise he could evre wish from Neowin, without having actually earned it. This has never lead to improvements.
TechPowerUp GPU-Z 2.70.0 by Razvan Serea
GPU-Z is a lightweight system utility designed to provide vital information about your video card and graphics processor. At launch, it automatically scans your system and reports the card name, GPU, release date and transistors, BIOS version, ROPs, memory type, and memory size.
Main Features:
Supports NVIDIA, AMD, ATI and Intel graphics devices
Displays adapter, GPU and display information
Displays overclock, default clocks and 3D clocks (if available)
Includes a GPU load test to verify PCI-Express lane configuration
Validation of results
GPU-Z can create a backup of your graphics card BIOS
No installation required, optional installer is available
Support for Windows XP / Vista / Windows 7 / Windows 8 / Windows 10 (both 32 and 64 bit versions are supported)
GPU-Z 2.70.0 changelog:
Improved kernel driver security
Added die size for Qualcomm Adreno 741
Added support for NVIDIA RTX 6000D, RTX Pro 500 Blackwell Embedded, Tesla V100-DGXS-32GB, PG500-216
Added support for Intel Arc Pro B70, B65, A60 ES, Alder Lake ES
Added support for Qualcomm Snapdragon X2 Elite, 778G/782G
Added vendor detection for HKC/Sambada, AWES
Download page: GPU-Z 2.70.0 | 11.1 MB (Freeware)
View: GPU-Z Website | Screenshot
Get alerted to all of our Software updates on Twitter at @NeowinSoftware
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