首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我怎样才能修复代码点火器3的路径?

我怎样才能修复代码点火器3的路径?
EN

Stack Overflow用户
提问于 2016-09-01 23:53:31
回答 2查看 311关注 0票数 1

某些东西不起作用,我的routes.php文件中有这个

代码语言:javascript
复制
$route['default_controller'] = 'books';
$route['404_override'] = '';
$route['translate_uri_dashes'] = TRUE;


$route['cities']['get'] = 'cities/index';
$route['cities/(:num)']['get'] = 'cities/find/$1';
$route['cities']['post'] = 'cities/index';
$route['cities/(:num)']['put'] = 'cities/index/$1';
$route['cities/(:num)']['delete'] = 'cities/index/$1';

和我的.htaccess就像

代码语言:javascript
复制
Options FollowSymLinks
<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

这里的问题是,当我进入googleChrome时,我键入的url如下:.www.domain.com.mx/project-server/

它把我发送到默认控制器,它是书籍,或欢迎,或任何地方。但是当我想像这样在我的url上键入它时

.www.domain.com.mx/project/book出现了如下错误:在此服务器上找不到所请求的URL /project/cities。

这是我在github https://github.com/cmurra/project-server的项目

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-09-02 03:28:45

更改您对此的访问权限

代码语言:javascript
复制
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /<YOUR_ROOT_FOLDER>
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php/$l [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|images|robots\.txt|css)
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 / index.php
</IfModule>

编辑

为了澄清,我认为问题在于代码点火器正在寻找index.php

代码语言:javascript
复制
www.domain.com.mx/project-server/index.php/books

代码语言:javascript
复制
www.domain.com.mx/index.php/project-server/books

是其中之一

票数 0
EN

Stack Overflow用户

发布于 2016-09-02 13:55:13

另外,您可能希望检查配置$route['translate_uri_dashes'] = TRUE;,尝试将其设置为FALSE ( URL $route['translate_uri_dashes'] = TRUE; https://www.codeigniter.com/userguide3/general/routing.html )

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39282459

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档