簡體   English   中英

找不到php-Codeigniter網址

[英]php-Codeigniter url not found

我在/ htdocs / trunk文件夾中有一個項目。 諸如“應用程序”,“系統”之類的Codeigniter文件夾結構存在於干線內部。 以下是/ htdocs / trunk / application內的.htaccess文件:

<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.  

任何幫助將不勝感激。 謝謝

我認為您應該跳過URL之間的index.php。 請在URL之間包含index.php,並檢查其是否有效。

例如: http:// localhost:90 / codeigniter_captcha / index.php / {controller_name}。

之后,如果要跳過URL之間的index.php,請在配置文件中進行更改。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM