301/302 redirect from slash to specific homepage URL

I was asked by my SEO client agency to redirect 302 on their website’s home page to a more specific URL of the same page, that is (and not the root version of the slash) . This is a WordPress site running on Apache2 with a .htaccess file. I need to achieve the following:

Redirect from:

http://www.example.com/

302 redirect to:

http://www.example.com/home/

I thought I could do this:

redirect 302 / http://www.example.com/home/ 

But of course, this redirects everything to this URL. Therefore, I think I need some kind of regular expression, but not sure how to create the desired effect? Can someone point me in the right direction? Any feedback is greatly appreciated .;)

+5
source share
2

:

RedirectMatch 302 ^/$ /home/

, root /home/

+10

Redirect , , , URL-, /... ALL. RedirectMatch :

Redirect, .

, :

RedirectMatch temp ^/$ /home/
+5

All Articles