Forum Moderators: phranque
Redirect 301 OLD http://www.domain.com/new but i have been looking around for examples of this over the last 1-2 hours at using rewrite but have not been able to get anything more than the redirect 301 to work. Note that Rules and Conditions work on a "two steps forward, one step back" principle. Apache doesn't even look at the RewriteCond unless the RewriteRule might apply. So for example:
RewriteCond %{HTTP_REFERER} {site-I-can't-stand}
RewriteRule foobar\.html {blahblah}
If the request being processed is not for a page called foobar.html, then mod_rewrite moves along without ever looking at the Condition. You could say
RewriteCond %{REQUEST_URI} foobar\.html
RewriteCond %{HTTP_REFERER} {site-I-can't-stand}
RewriteRule [a-z]+\.html {blahblah}
and it would "work", but it would waste a lot of server time* and resources because now it has to look up the Conditions every single time anyone requests a page.