How would I write a .htaccess redirect rule if the URL contains a certain word?
.htaccess
e.g. if it contains foobar then redirect to index.php
foobar
index.php
RewriteRule ^(.*)foobar(.*)$ http://www.example.com/index.php [L,R=301]
(No space inside your website)