2017-04-05 239 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.

为我工作

我希望它能为你工作!