我在/ htdocs / trunk文件夹中有一个项目。 Codeigniter文件夹结构,例如'application','system'等存在于trunk中。下面是.htaccess文件,它位于/ 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>
以下是我的config.php:
$config['base_url'] = 'http://localhost/trunk/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
当我在浏览器中打开上面的基本URL时,我成功获取了登录页面。但是,当我点击调用控制器功能的锚链接时,我得到403 Forbidden。以下是路线,视图和错误: -
routes.php
$route['default_controller'] = "chomecontroller";
$route['search'] = "csearchentrycontroller";
$route['search/(:any)'] = "csearchentrycontroller/$1";
查看
<a href="<? echo base_url();?>search/searchEntry/4/1"> Redirect here </a>
错误
You don't have permission to access /trunk/< on this server.
任何帮助都将受到高度赞赏。谢谢
答案 0 :(得分:0)
我想你会跳过URL之间的index.php。 请在URL之间包含index.php并检查其是否正常工作。
Ex:http://localhost:90/codeigniter_captcha/index.php/ {controller_name}。
之后,如果你想跳过URL之间的index.php,请在配置文件中更改它。