2015-05-08 22:31:49 4267次浏览 2条回答 0 悬赏 9 金钱

今天配置了一个路由, 但是配置好了之后却报 not found
这个是我的配置:

'urlManager'=>[
	'enablePrettyUrl' => true,
	'showScriptName' => false,
	'suffix' => '.html',
]

没有配置前的路径为 http://127.0.0.1:8000/blog-advanced/backend/web/index.php?r=sys/index
配置之后为 http://127.0.0.1:8000/blog-advanced/backend/web/sys/index.html

没配置路由钱一切正常,配置了之后就报下面的问题

Not Found

The requested URL /blog-advanced/backend/web/sys/index.html was not found on this server.

最佳答案

  • 发布于 2015-05-09 10:13 举报

    .htaccess 的

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule (.*) index.php [NC,L]
    
    3 条回复
    回复于 2015-05-09 10:26 回复

    文件名拼错了,是.htaccess

    回复于 2015-05-09 10:27 回复

    是的,修改过来了。

    回复于 2015-05-09 10:27 回复

    文件名拼错了,是.htaccess

  • 回答于 2015-05-09 03:06 举报

    .htacess 文件加下

    3 条回复
    回复于 2015-05-09 09:56 回复

    加什么?。。。。。。。

    回复于 2015-05-10 22:28 回复

    .htaccess 文件放在你的 indx.php 同级,内容如下

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule (.*) index.php [NC,L]
    
    回复于 2015-07-16 16:02 回复

    小伙儿。。。。我按照你说的做了 不行 肿么办

您需要登录后才可以回答。登录 | 立即注册
word1018808441
CEO

word1018808441 重庆

注册时间:2015-03-24
最后登录:2018-07-04
在线时长:629小时49分
  • 粉丝49
  • 金钱7395
  • 威望40
  • 积分14085

热门问题