dsfhe34889789708 2016-11-20 18:43
浏览 39
已采纳

找不到php-Codeigniter网址

I have a project inside /htdocs/trunk folder. Codeigniter folder structure such as 'application', 'system' etc exist inside trunk. Below is .htaccess file which is inside /htdocs/trunk/application:

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/system/.* [NC]
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

        # Directs all EE web requests through the site index file
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

Below is my config.php:

$config['base_url'] = 'http://localhost/trunk/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';  

When I open the base url above in the browser, I successfully get my login page. However, when I click on anchor link which calls the controller function, I get 403 Forbidden. Below is routes, view and error:-

routes.php

$route['default_controller'] = "chomecontroller";
$route['search'] = "csearchentrycontroller";
$route['search/(:any)'] = "csearchentrycontroller/$1";

view

<a href="<? echo base_url();?>search/searchEntry/4/1"> Redirect here </a>  

error

You don't have permission to access /trunk/< on this server.  

Any help would be highly appreciated. Thank you

  • 写回答

1条回答 默认 最新

  • dounan4479 2016-11-21 09:12
    关注

    I think so You would have skip the index.php in between the URL. Please include index.php in between URL and check whether its working or not.

    Ex: http://localhost:90/codeigniter_captcha/index.php/{controller_name}.

    After that if you want to skip index.php in between URL change it in Config File.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于这个问题的解释说明
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备
  • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。