i think this can help you:
use the below code in your theme’s functions.php
function redirect_homepage() {
if( ! is_home() && ! is_front_page() )
return;
wp_redirect( 'http://siteurl.com/news', 301 );
exit;
}
add_action( 'template_redirect', 'redirect_homepage' );
Related Posts:
- How to remove /index.php/ from URL’s
- Run WordPress frontend and backend in different domains
- How to remove “http://” When Echoing URL?
- How can I change all links on pages to point to a different domain from where the site is hosted?
- Remove site root trailing slash
- URL parsing – what is it?
- Changing my site url from azure.net to custom domain
- Remove / from www.example.com/ [closed]
- Avoid the removal of “https:” from URLs
- Confusion about Site url and directory
- WordPress get parameter ‘unapproved’ and ‘moderation-hash’
- Changing the website URL to the root folder
- Showing my server ip in source code for several links not for all links
- How do I avoid messing up URLs when switching from example.com/subdir to example.com?
- Cannot access WordPress website from external IP while internally it is working properly [closed]
- DNS – Change WordPress Site Name?
- Alternatives to site_url() and get_template_directory_uri()
- What is the best way to revert to www version of domain name?
- Changing siteurl in the database not working
- How to make a seo friendly URL of 2 different pages with same words
- Why my URL has an unknown character string?
- Two domain site: Link base URLs point to wrong domain
- Making a site URL
- Custom plugin route in WordPress
- Why is ?doing_wp_cron being appended to my URLs
- use query string in URL to display content on the page
- Change default URL path (/blog/) of blog posts
- How to deal with WordPress on localhost
- How to convert the file path to a URL of the same file?
- Why is WordPress saving full-urls to the database?
- Get taxonomy slug from url
- Load images with http urls inside https post
- Force the Website URL to Include “www” and to be Upper Case?
- WordPress and $_GET Params
- List of default WordPress URLs
- Why WP encodes UNICODE (UTF8) containing urls? Any drawbacks of UNICODE url?
- Unable to load static front page on home url
- Force home page to be https?
- WP redirects all pages from new domain to old domain
- redirect 301 old url to new url
- How to update media links in WordPress after migration?
- Why ids in urls don’t work but slugs do?
- Old URL Redirect website after migration
- Check request URL for pattern
- Rewrite WordPress Standard Feed URL – /feed/ to feed.xml
- wp_insert_post – How do I prevent incremental numbers on child pages?
- Getting 404 Hits on URI -/-/-/-/-/-/-/-/-/- . How to deal
- How to change logo url [closed]
- Dynamic URL based on user_metadata
- Check if user is logged in to site A when visiting site B
- Make homepage a non-WordPress page
- Localhost port is missing on some links after downgrading MAMP [closed]
- Content duplication issue with dynamic URLs
- Why am I seeing all these weird ‘loginid’ requests?
- Remove trailing slash from previous_posts_link()
- Will get_bloginfo(‘url’) return URL with backslash?
- Linking to pages/posts within the site
- Using esc_url_raw with protocols properly
- How can I identify which file/function will be used to respond to a particular URL?
- Is there a way to test if a URL is part of the current blog?
- wordpress copyright dynamic
- Could not find the wordpress page
- An anchor name (id name) in the address bar
- get_template_directory() returns wrong address on VPS
- How to close tab automatically if URL has specific word? [closed]
- Make custom system url
- Image not showing up in media loader success area – followup
- How do I allow http/ftp access to files I have uploaded?
- Redirecting URL with Twitter Button API Not Working
- Need help changing back the correct wordpress url
- Adding Parent Categories and keep current URLs
- How to display translated content with custom slug?
- Different url to same page (with dynamic content)
- WordPress option com_jce should not work
- Too many redirects (ERR_TOO_MANY_REDIRECTS) only on one page
- WordPress Still Requesting Old Url
- Broken Images and Style
- How to generate expiring URL of the page?
- WordPress Website change directory
- Allow duplicate slugs for pages and posts
- i1.wp.com url problem (Jetpack not installed)
- incorrect url in Snippet editor
- WordPress dynamic subpage for ACF
- How to change URL of my pages?
- WordPress Address (URL) Reverts back
- Modify the WordPress URL
- Duplicate pages with ?s parameter
- How to pass REQUEST_URI to function
- Populate Website URL at registration time
- WordPress Update Links
- wordpress url with format .com/category/sub-category
- URL Forwarding – wordpress links reverting back
- Get gallery url (Nextgen) [closed]
- redirect word-press page with page values
- help me remove this additional parameter in url
- Function to get custom post image URL
- Lost WordPress website access after changing URL [closed]
- How to run Wiki on the same host as WordPress and not get 404 errors when browsing to Wiki?
- Replace media external links with local links
- how to add param string after website url in wordpress?