错误信息:
Not Found
The requested URL was not found on this server.
Apache Server at ceshizhan.yizhanzzw.com Port 80
解决方法:
存在404的原因有很多,下面根据情况逐一排查解决。
1.首先先检查默认访问目录是否有index.php或者index.hml文件。
2.确认存在默认访问文件以后,再检查默认访问文档是否存在index.html或者index.html,没有则添加上。
3.确认上面1和2两个选项都没有问题以后,设置切换伪静态尝试,根据建站系统不同,选择的伪静态也有所不同,下面提供几个常用的Apache伪静态规则参考。
Apache伪静态在线转换Nginx伪静态地址:https://www.bt.cn/Tools
dedecms:
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)/question-id-([0-9]+)\.html$ $1/question\.php\?id=$2
RewriteRule ^(.*)/browser-tid-([0-9]+)\.html$ $1/browser\.php\?tid=$2
RewriteRule ^(.*)/browser-tid2-([0-9]+)\.html$ $1/browser\.php\?tid2=$2
RewriteRule ^(.*)/browser-lm-([0-9]+)\.html$ $1/browser\.php\?lm=$2
RewriteRule ^(.*)/browser-tid-([0-9]+)-lm-([0-9]+)\.html$ $1/browser\.php\?tid=$2&lm=$3
RewriteRule ^(.*)/browser-tid2-([0-9]+)-lm-([0-9]+)\.html$ $1/browser\.php\?tid2=$2&lm=$3
RewriteRule ^(.*)index\.html$ $1/index.php
RewriteRule ^(.*)list-([0-9]+)\.html$ $1/plus/list.php?tid=$2
RewriteRule ^(.*)list-([0-9]+)-([0-9]+)\.html$ $1/plus/list.php?typeid=$2&PageNo=$3
RewriteRule ^(.*)view-([0-9]+).html$ $1/plus/view.php?aid=$2
RewriteRule ^(.*)view-([0-9]+)-([0-9]+).html$ $1/plus/view.php?aid=$2&pageno=$3
discuz:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2&%1
thinkphp:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
</IfModule>
wordpress:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
EmpireCMS:
RewriteEngine On
RewriteBase /
RewriteRule ^([0-9]+).([0-9]+)/$ e/action/ShowInfo.php?classid=$1&id=$2 [L]
RewriteRule ^([0-9]+).([0-9]+)$ $1.$2/ [L,R=301]
RewriteRule ^([0-9]+)/$ e/action/ListInfo/?classid=$1 [L]
RewriteRule ^([0-9]+)$ $1/ [L,R=301]
RewriteRule ^list([0-9]+).([0-9]+)/$ e/action/ListInfo/index.php?page=$1&classid=$2 [L]
RewriteRule ^list([0-9]+).([0-9]+)$ list$1.$2/ [L,R=301]
RewriteRule^archive([0-9]+).([0-9]+)-([0-9]+)-([0-9]+)/$e/action/ListInfo.php?classid=$1&mid=1&tempid=9&starttime=$2-$3-$4&endtime=$2-$3-$4 [L]
RewriteRule^archive([0-9]+).([0-9]+)-([0-9]+)-([0-9]+)$^archive([0-9]+).([0-9]+)-([0-9]+)-([0-9]+)/ [L,R=301]
通过以上方法排除基本就可以解决404
Not Found
The requested URL was not found on this server.
错误问题。
THE END
暂无评论内容