Can I use mod_rewrite to change file extensions? .Jpeg to .jpg for example

I'm looking to use Apache's mod_rewrite to work with a file as .jpg instead of .jpeg. Is it possible?

+2


source to share


2 answers


Try the following:



RewriteEngine on
RewriteRule ^(.+)\.jpeg$ $1.jpg

      

+4


source


You can rewrite the jpeg extension to jpg using the following rule in htaccess:



RewriteEngine on

RewriteRule ^(.+)\.jpeg$ /$1.jpg [L]

      

0


source







All Articles