2017-04-05 241 views
1

大家好我試圖重定向到儀表板控制器addLocation功能admin文件夾下,我已經給了低於其出404頁的鏈接沒有發現,404頁,而在笨頁面重定向

http://localhost/kooly/admin/dashboard/addLocation

這是我htaccess文件幫我解決這個問題的重定向

的.htaccess

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase /kooly/ 
DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] 
</IfModule> 

<IfModule !mod_rewrite.c> 
    # If we don't have mod_rewrite installed, all 404's 
    # can be sent to index.php, and everything works as normal. 
    # Submitted by: ElliotHaughin 

    ErrorDocument 404 /index.php 
</IfModule> 

回答

0

試試這個,外面保存您的應用程序文件夾的

<IfModule mod_rewrite.c> 

    RewriteEngine On 
    RewriteBase /your folder/ 

    RewriteCond %{REQUEST_URI} ^system.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 

    RewriteCond %{REQUEST_URI} ^application.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 

    RewriteCond $1 !^(index\.php|assets|images|robots\.txt) 
    RewriteRule ^(.*)$ index.php/$1 [L] 

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

</IfModule> 

<IfModule !mod_rewrite.c> 
    # If we don't have mod_rewrite installed, all 404's 
    # can be sent to index.php, and everything works as normal. 

ErrorDocument 404 /index.php 

</IfModule> 
+0

我試過它得到相同的錯誤 –

+0

本地主機/ kooly /管理員/儀表板 你可以嘗試,如果你可以訪問此鏈接? –

+0

是的,我可以訪問該鏈接。現在它的工作對我來說,我給了我的網址大寫字母我已經改變了addLocation現在它的工作addlocation謝謝@Gennia –

0

嘗試下面的.htaccess代碼。

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* index.php?/$0 [PT,L] 
RewriteRule ^/?ajax/(.*)$ ajax.php?$1 [NC,QSA,L] 
<IfModule mod_headers.c> 
    header add Access-Control-Allow-Origin: "*" 
</IfModule> 
+0

仍然收到相同的404頁面未找到 –

+0

您正在使用哪個codeigniter版本? –

+0

正在使用codeigniter 3 –

0

您可以添加以下代碼到你的.htaccess文件

<IfModule mod_rewrite.c> 
    RewriteEngine On 

    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 

    # Rewrite all other URLs to index.php/URL 
    RewriteRule ^(.*)$ index.php?url=$1 [PT,L] 

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

它使用笨3.

爲我工作

我希望它能爲你工作!