redirect 301 all traffic to homepage

I want to redirect all traffic request uri to homepage of my wordpress page.
I try override default wordpress, but cant get this to work any one can help in this ?

I try following:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /wordpress/

RewriteBase /

<If "%{REQUEST_URI} != 'http://127.0.0.1/wordpress/'">
    Redirect 301 / http://127.0.0.1/wordpress/
</if>

#RewriteRule (.*) http://127.0.0.1/wordpress/ [R=301,L]




RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

# END WordPress

Related posts

Leave a Reply

1 comment