10/10/2018, 00:24
lỗi index.php ai giúp với
mới tập làm web, đc. cái http://mistarg.summerhost.info, nhưng mỗi lần vào http://mistarg.summerhost.info nó ko tự động redirect tới http://mistarg.summerhost.info/index.php được. ai giúp với.
Bài liên quan





và chỉ có duy nhất 1 file index thôi.
---------------------------------------
mới test tài khoản khác, thì nó lại tự động chuyển tới news.php, chẳng hiểu thế nào. http://mistarg1.summerhost.info
thêm đoạn này vào trên cùng index.php
if (strpos($_SERVER***91;'REQUEST_URI'***93;, '/index.php') < 0) {
header('Location: /index.php');
exit();
}
if (false === strpos($_SERVER***91;'REQUEST_URI'***93;, '/index.php')) {
header('Location: /index.php');
exit();
}
<?php if (false === strpos($_SERVER['REQUEST_URI'], '/index.php')) { header('Location: /index.php'); exit(); } /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require('./wp-blog-header.php'); ?>if (false === strpos($_SERVER['REQUEST_URL'], '/index.php')) { header('Location: /index.php'); exit(); }