Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Wordpress中省略index.php?_Php_Wordpress_Redirect - Fatal编程技术网

如何在Wordpress中省略index.php?

如何在Wordpress中省略index.php?,php,wordpress,redirect,Php,Wordpress,Redirect,有没有可能省略Wordpress中的index.php?我的项目只使用页面(page.php)工作,我使用Lingotek拥有多种语言 如果我输入,应该显示首页,但它不显示任何内容(我想解决这个问题) 如果我直接打到 我的想法是通过index.php直接重定向到首页。你会怎么做 在index.php中,您可以将页面称为“主页”: <?php get_header(); ?> <?php $query = new WP_Query('pagename=home'); i

有没有可能省略Wordpress中的index.php?我的项目只使用页面(page.php)工作,我使用Lingotek拥有多种语言

  • 如果我输入,应该显示首页,但它不显示任何内容(我想解决这个问题)

  • 如果我直接打到


  • 我的想法是通过index.php直接重定向到首页。你会怎么做

    在index.php中,您可以将页面称为“主页”:

    <?php get_header(); ?>
    
        <?php $query = new WP_Query('pagename=home'); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); ?>
    
            <?php the_content();?>
    
        <?php } } wp_reset_postdata(); ?>
    
    <?php get_footer(); ?>
    

    尝试使用.htaccess重定向页面