Reputation: 1575
I want to redirect user to home page when he just enters on the website. For example typing www.website.com need redirect to www.website.com/home
I trued to redirect using
header("Location: www.example.com/home");
bu it didn't work what are other methods to do it and not using any wp plugin for this?
Upvotes: -1
Views: 1124
Reputation: 171
Use template redirect hook and for redirects. place below code in your themes function.php
add_action( 'template_redirect', 'mytheme_redirect' );
function mytheme_redirect(){
// Your code
wp_redirect( home_url() ); exit;
}
Upvotes: 0
Reputation: 4388
Go to Settings
> Reading
in your Admin Dashboard.
Then, under Front page displays
, click on A static page
and select your page which you want as front page.
Upvotes: 2