Redirect empty searches to root

Adding this snippet to your .htaccess file, will redirect empty searches to root. Be sure to backup your htaccess first.

# Redirect Empty Searches to root
RewriteCond %{QUERY_STRING} ^s=$
RewriteRule ^ /? [L,R=301]

Comments  Leave a Reply

  1. Tweets that mention Wordpress Redirect empty searches to root – wpsnipp.com Wordpress code snippets for your blog -- Topsy.com February 17, 2011 at 10:53 am

    […] This post was mentioned on Twitter by Timoa, WPSNIPP. WPSNIPP said: #wordpress Redirect empty searches to root http://bit.ly/fkwKyc #blog please RT 🙂 […]

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!