0

is there any way how to achieve this? I've tried to google it, but I have no clue how to call it.

siteurl.com - for whole web

siteurl.com/news - homepage with news

When I add siteurl.com I have to by directly redirected to siteurl.com/new. It's needed because some google analytics setting or so which will be more precise. Thanks a lot for your help.

EDIT: siteurl.com/news - needs to be "frontpage" and set as "homepage" (theme template issue, it's really complicated to change it to a custom page. Something as "fake url" or so, is it possible to achieve this?

  • Create a site at siteurl.com and create a page Home, set it as custom homepage. Then create a page News and set it as blog post page to display blog posts. You can do that from Settings > Reading Settings section in WordPress admin panel. – Robert hue Jun 2 '15 at 10:39
  • Thanks, but that's not this case. We don't use any blog posts. I simply need change the url which is used for frontpage to site.com/news but it still needs to be the homepage... – kybernaut.cz Jun 3 '15 at 7:34
1

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' );
  • Please file an edit and explain how your code works. Your answer popped up as very low quality. Please take your time and correct your answer. See How to Answer – Pieter Goosen Jun 2 '15 at 11:44
  • @PieterGoosen it help for conditionally redirect. please check here for reference stackoverflow.com/questions/16738311/… – sohan Jun 2 '15 at 11:53
  • That info needs to be inside your answer, not a comment. As I said, file an edit with the useful info, i think this can help you: is useless info – Pieter Goosen Jun 2 '15 at 11:58
  • Also, post the relevant info from the link, please check here for reference is also pretty useless if the link is removed – Pieter Goosen Jun 2 '15 at 11:59
  • oh well i understood @PieterGoosen thanks for suggestion. – sohan Jun 2 '15 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.