How would I write a .htaccess redirect rule if the URL contains a certain word?
e.g. if it contains foobar then redirect to index.php
RewriteCond %{REQUEST_URI} foobar RewriteRule .* index.php or some variant thereof.
RewriteRule ^(.*)foobar(.*)$ http://www.example.com/index.php [L,R=301] (No space inside your website)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With