I'd like the following image URL
http://www.example.com/image-provider/article/1275449_inline3_scale_700xauto.jpg
to be redirected to the following PHP script that will actually generate the content
http://www.example.com/image-provider?url=article/1275449_inline3_scale_700xauto.jpg
I've tried the following syntax in my .htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/image-provider/(.*)$ image-provider?url=$1 [L]
With no success so far:I still get a 404. Is there something wrong in my .htaccess ?
You can use this rule:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(image-provider)/(.+)$ $1?url=$2 [L,QSA,NC]
Couple of issues in your rule:
.htaccess.+ to avoid matching /image-provider/ as an URI.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With