Reputation: 565
Here is my .htaccess
.
ErrorDocument 404 /error/404.php
RewriteEngine On
RewriteRule ^\/images\/(.*)\.png$ /images/%1.jpg
Now what I want to do is that
http://blabla1001.net46.net/images/pegion.png
should be redirected to
http://blabla1001.net46.net/images/pegion.jpg
but this does not happen instead I am getting redirected to 404.php
.
Why is this happening?
Here is my directory structure:
Upvotes: 2
Views: 30
Reputation: 785266
%1
is actually back-reference for value captured in RewriteCond
, use $1
:
ErrorDocument 404 /error/404.php
RewriteEngine On
RewriteRule ^(images/.+?)\.png$ /$1.jpg [NE,L,NC,R=302]
Upvotes: 2