Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 213
trakker Avatar asked Dec 11 '10 23:12

trakker


1 Answers

This should do what you are after:

RewriteEngine On
RewriteRule ^$ /my-target-page/ [R=301,L]
like image 83
Ben Avatar answered Oct 24 '22 22:10

Ben