trakker
trakker

Reputation: 73

Use htaccess to redirect wordpress homepage to subpage

Sorry for what is probably a simple thing, but not for me...

I need to redirect all requests for the domain root to a specific page on my wordpress site, without breaking everything else. What I've been trying so far is:

RewriteCond %{HTTP_HOST} !^mydomain\.com/my-target-page/$ [NC]

RewriteRule ^ http://mydomain.com/my-target-page/ [R=301,L]

It does indeed redirect to the url mydomain/my-target-page/ , but it doesn't resolve to anything. I think that wordpress doesn't work with this, and I'm not even close, but can't wrap my head around what I should do here. Help!

Upvotes: 7

Views: 11267

Answers (1)

Ben
Ben

Reputation: 3962

This should do what you are after:

RewriteEngine On
RewriteRule ^$ /my-target-page/ [R=301,L]

Upvotes: 13

Related Questions