Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.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
MyBB URL重写赢得';行不通_Url_Http Status Code 404_Friendly Url_Mybb - Fatal编程技术网

MyBB URL重写赢得';行不通

MyBB URL重写赢得';行不通,url,http-status-code-404,friendly-url,mybb,Url,Http Status Code 404,Friendly Url,Mybb,我正在尝试在MyBB板上启用URL重写,我在Admin CP中启用了它,并将板上附带的default.htaccess文件放入我的论坛根目录中,但当我尝试访问线程时,它返回:在此服务器上找不到请求的URL/thread-86-lastpost.html。 404找不到 我应该怎么做才能修复它? 我想问题出在我的apache2.conf文件中,但我不知道如何修复它 论坛位于我的Debian VPS上,我在那里安装了带有PHP和所有其他东西的Apache2。灯 我的.htaccess文件: Opti

我正在尝试在MyBB板上启用URL重写,我在Admin CP中启用了它,并将板上附带的default.htaccess文件放入我的论坛根目录中,但当我尝试访问线程时,它返回:在此服务器上找不到请求的URL/thread-86-lastpost.html。 404找不到

我应该怎么做才能修复它? 我想问题出在我的apache2.conf文件中,但我不知道如何修复它

论坛位于我的Debian VPS上,我在那里安装了带有PHP和所有其他东西的Apache2。灯

我的.htaccess文件:

Options -MultiViews +FollowSymlinks -Indexes

#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
#   MediaTemple, it is known to cause random Internal Server
#   errors. For MediaTemple, please remove the block below
#
<IfModule mod_security.c>
    # Turn off mod_security filtering.
    SecFilterEngine Off

    # The below probably isn't needed, but better safe than sorry.
    SecFilterScanPOST Off
</IfModule>

#
# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
#   the setting enabled in the Admin CP and you have this file
#   named .htaccess
#
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA]
    RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA]

    RewriteRule ^thread-([0-9]+)\.html$ showthread.php?tid=$1 [L,QSA]
    RewriteRule ^thread-([0-9]+)-page-([0-9]+)\.html$ showthread.php?tid=$1&page=$2 [L,QSA]
    RewriteRule ^thread-([0-9]+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost [L,QSA]
    RewriteRule ^thread-([0-9]+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest [L,QSA]
    RewriteRule ^thread-([0-9]+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest [L,QSA]
    RewriteRule ^thread-([0-9]+)-newpost\.html$ showthread.php?tid=$1&action=newpost [L,QSA]
    RewriteRule ^thread-([0-9]+)-post-([0-9]+)\.html$ showthread.php?tid=$1&pid=$2 [L,QSA]

    RewriteRule ^post-([0-9]+)\.html$ showthread.php?pid=$1 [L,QSA]

    RewriteRule ^announcement-([0-9]+)\.html$ announcements.php?aid=$1 [L,QSA]

    RewriteRule ^user-([0-9]+)\.html$ member.php?action=profile&uid=$1 [L,QSA]

    RewriteRule ^calendar-([0-9]+)\.html$ calendar.php?calendar=$1 [L,QSA]
    RewriteRule ^calendar-([0-9]+)-year-([0-9]+)\.html$ calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]
    RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
    RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]
    RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+)\.html$ calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]

    RewriteRule ^event-([0-9]+)\.html$ calendar.php?action=event&eid=$1 [L,QSA]

    <IfModule mod_env.c>
        SetEnv SEO_SUPPORT 1
    </IfModule>
</IfModule>

#
# If Apache is compiled with built in mod_deflade/GZIP support
# then GZIP Javascript, CSS, HTML and XML so they're sent to
# the client faster.
#
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE application/javascript text/css text/html text/xml
</IfModule>
Options-多视图+FollowSymlinks-索引
#
#如果mod_security已启用,请尝试禁用它。
#-注意,这将适用于大多数主机,但不适用于
#例如,已知会导致随机内部服务器
#错误。例如,请删除下面的块
#
#关闭mod_安全过滤。
分离过滤器发动机关闭
#下面的内容可能不需要,但安全总比抱歉好。
secfilters可以关闭
#
#MyBB“搜索引擎友好”URL重写
#-注意,要使这些与MyBB一起使用,请确保
#在管理CP中启用该设置,并且您拥有此文件
#命名的.htaccess
#
重新启动发动机
重写规则^forum-([0-9]+)\.html$forumdisplay.php?fid=$1[L,QSA]
重写规则^forum-([0-9]+)-page-([0-9]+)\.html$forumdisplay.php?fid=$1&page=$2[L,QSA]
重写规则^thread-([0-9]+)\.html$showthread.php?tid=$1[L,QSA]
重写规则^thread-([0-9]+)-page-([0-9]+)\.html$showthread.php?tid=$1&page=$2[L,QSA]
重写规则^thread-([0-9]+)-lastpost\.html$showthread.php?tid=$1&action=lastpost[L,QSA]
重写规则^thread-([0-9]+)-nextnewest\.html$showthread.php?tid=$1&action=nextnewest[L,QSA]
重写规则^thread-([0-9]+)-nextoldest\.html$showthread.php?tid=$1&action=nextoldest[L,QSA]
重写规则^thread-([0-9]+)-newpost\.html$showthread.php?tid=$1&action=newpost[L,QSA]
重写规则^thread-([0-9]+)-post-([0-9]+)\.html$showthread.php?tid=$1&pid=$2[L,QSA]
重写规则^post-([0-9]+)\.html$showthread.php?pid=$1[L,QSA]
重写规则^announcement-([0-9]+)\.html$announcements.php?aid=$1[L,QSA]
重写规则^user-([0-9]+)\.html$member.php?action=profile&uid=1[L,QSA]
重写规则^calendar-([0-9]+)\.html$calendar.php?calendar=$1[L,QSA]
重写规则^calendar-([0-9]+)-year-([0-9]+)\.html$calendar.php?action=yearview&calendar=$1&year=$2[L,QSA]
重写规则^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$calendar.php?calendar=$1,year=$2,month=$3[L,QSA]
重写规则^calendar-([0-9]+)-年-([0-9]+)-月-([0-9]+)-日-([0-9]+)\.html$calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4[L,QSA]
重写规则^calendar-([0-9]+)-week-(n?[0-9]+)\.html$calendar.php?action=weekview&calendar=$1&week=$2[L,QSA]
重写规则^event-([0-9]+)\.html$calendar.php?action=event&eid=1[L,QSA]
SetEnv SEO_支持1
#
#如果Apache是使用内置的mod_deflade/GZIP支持编译的
#然后GZIP Javascript、CSS、HTML和XML将它们发送到
#客户端速度更快。
#
AddOutputFilterByType DEFLATE应用程序/javascript文本/css文本/html文本/xml

我建议你试试谷歌搜索引擎优化插件:


它更易于使用,并为你的董事会创建了出色的SEO。

我正在使用它。问题出在我的apache重写模块中。现在一切都好了-