如何在Wordpress中省略index.php?
有没有可能省略Wordpress中的index.php?我的项目只使用页面(page.php)工作,我使用Lingotek拥有多种语言如何在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
我的想法是通过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重定向页面