有关虎翼网域名通主机discuz论坛的URL静态化的问题(高手请进)

来源:百度知道 编辑:UC知道 时间:2024/09/23 19:23:14
我通过php程序生成.htaccess文件,结果上传到/bbs/目录,/bbs/install.php就打不开了,出现400错误。删除以后又可以打开了。因为域名通数据库没有新建数据库的权限,所以出现“database_errno_1044 无法创建新的数据库,请检查数据库名称填写是否正确”的问题,只能通过discuz论坛的URL静态化解决。但是,为什么一把.htaccess文件传上去,就出现400错误呢?
附.htaccess文件:
<?php
// echo $content;
$filename = ".htaccess";
$handle = fopen ($filename,"w"); //打开文件指针,创建文件
/*
检查文件是否被创建且可写
*/
$text1="RewriteEngine On\n";
$text2="RewriteBase /bbs/discuz";
$text3="RewriteRule ^archiver/((fid|tid)-[0-9]+\.shtml)$ archiver/index.php?$1";
$text4="RewriteRule ^forum-([0-9]+)-([0-9]+)\.shtml$ forumdisplay.php?fid=$1&page=$2";
$text5="RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.shtml$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2";
$text6="RewriteRule ^space-(username|uid)-(.+)\.shtml$ space.php?$1=$2";
$text7="RewriteRule ^tag-(.+)\.shtml$ tag.php

<?php
// echo $content;
$filename = ".htaccess";
$handle = fopen ($filename,"w"); //打开文件指针,创建文件
/*
检查文件是否被创建且可写
*/
$text1="RewriteEngine On\r\n";
$text2="RewriteBase /bbs\r\n";
$text3="RewriteRule ^archiver/((fid|tid)-[0-9]+\.shtml)$ archiver/index.php?$1\r\n";
$text4="RewriteRule ^forum-([0-9]+)-([0-9]+)\.shtml$ forumdisplay.php?fid=$1&page=$2\r\n";
$text5="RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.shtml$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2\r\n";
$text6="RewriteRule ^space-(username|uid)-(.+)\.shtml$ space.php?$1=$2";
$text7="RewriteRule ^tag-(.+)\.shtml$ tag.php?name=$1\r\n";
if (!is_writable ($filename)){
die ("文件:".$filename."不可写,请检查其属性后重试!");
}
if (!fwrite ($handle,$text1.$text2.$text3.$text4.$te