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 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)
  • ¥15 机器人轨迹规划相关问题
  • ¥15 word样式右侧翻页键消失