Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rewrite all URLs except one

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

like image 749
Joe Mornin Avatar asked Oct 14 '11 14:10

Joe Mornin


1 Answers

Try this:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/image.png$
RewriteRule (.*) index.php?page=%{REQUEST_URI} [L,NC,QSA]
like image 90
Book Of Zeus Avatar answered Nov 04 '22 07:11

Book Of Zeus