Rewrite all but one URL

I have a website that has moved to a new home. I would redirect all the URLs of this site (domain.com/*) to domain.com/index.php except domain.com/image.png. Can anyone suggest a mod_rewrite rule that would rewrite all the URLs except the URL for the image file?

+5
source share
1 answer

Try the following:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/image.png$
RewriteRule (.*) index.php?page=%{REQUEST_URI} [L,NC,QSA]
+10
source

All Articles