Forum Moderators: phranque
This what i am trying to do:
2 things:
1. if someone types mydomain.com/(ANYTHING THEY WANT) it will forward to myurl.com - that works--great
but...
2. if someones types mydomain/(anythingtheylike).jpg it wil forward to a certain image - this doesn't work
I know it is something really simple, i just cant figure this out.
Any help is really appreciated
Simon
RewriteEngine on
#
# Redirect all requests for non-image URLs which do not resolve to existing files or directories to the home page
RewriteCond %{REQUEST_URI} !\.(gif¦jpg¦png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) http://www.example.com/ [R=301,L]
#
# Redirect all requests for image URLs which do not resolve to existing images to the replacement image
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(gif¦jpg¦png)$ http://www.example.com/certain-image.gif [NC,R=301,L]
Jim