没有www,没问题。使用www
给出404错误日志PHP
<?php
header('Content-Type: text/html; charset=utf-8');
require_once('db.php');
$sefurl = mysql_escape_string($_GET['sef']);
if($sefurl==""){
$sefurl = 'homepage' ;
}else{
}
$sql = mysql_query("SELECT * FROM page WHERE sefurl='$sefurl'");
$data = mysql_fetch_assoc($sql);
switch($data){
case null;
echo "<center><h1 style='font-size:500px'>404</h1></center>";
break;
default:
.
.
?>
htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ([A-Za-z0-9]+).website.com
RewriteRule ^$ index.php?sef=%1
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+).html$ index.php?sef=$1 [L,QSA]
为什么会出现此错误。是否有想法
答案 0 :(得分:0)
更改
RewriteCond %{HTTP_HOST} ([A-Za-z0-9]+).website.com
到
RewriteCond %{HTTP_HOST} ([A-Za-z0-9]*).website.com