2016-07-29 60 views
-1

在mathwork文件夹我的笨项目 mathwork是另一个文件夹管理已经笨文件 admin管理员文件夹里面的文件夹中有一个笨文件库中所有有如何删除的index.php在笨项目

mathwork 
    --admin 

当我想尝试访问作为

http://localhost/mathwork/admin/authorize/add 

它显示错误404

当我尝试到作为CCESS

http://localhost/mathwork/admin/index.php/authorize/add 

其做工精细

如何删除index.php文件,并得到URL作为

http://localhost/mathwork/admin/authorize/add 
+0

您需要启用网址在你的网络服务器重写,并通过你'web.config'配置它( IIS)或'。htaccess'(apache)或其他配置您的网络服务器使用 – mituw16

+0

**阅读手册:** [从URL中删除'index.php'](http://www.codeigniter.com/user_guide/general/urls.html#删除这个索引的php文件) – Sparky

+0

可能的重复[如何从CodeIgniter的URL中删除'index.php'?](http://stackoverflow.com/questions/2192136/how-do-i-remove -index-php-from-url-in-codeigniter) – Sparky

回答

0

我使用WAMP和XAMPP和Windows 10

这的.htaccess似乎很好地工作,我

Options +FollowSymLinks 
Options -Indexes 
DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $1 !^(index\.php|images|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

广场htaccess的出应用程序文件夹的侧

  • yourproject
  • 您的项目> admin < - 应用程序文件夹
  • yourproject>管理员>的.htaccess
  • yourproject>管理员>的index.php you may need to change the system ../system

  • yourproject
  • yourproject>前端< - 应用程序文件夹
  • yourproject>系统
  • 您的项目> .htaccess
  • 您的项目>我ndex.php

在config.php文件

$config['base_url'] = 'http://localhost/yourproject/'; 
$config['index_page'] = ""; 

,您可以得到更多的.htaccess here

0

创建一个名为.htaccess文件(如果Apache)在相同的目录中index.php,打开它并添加:

RewriteEngine on 
RewriteCond $1 !^(index\.php|resources|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

下一个打开config.php并将$config['index_page'] = "index.php"更改为$config['index_page'] = ""

您的网址现在应该在地址栏中没有index.php的情况下运行。

+0

对我不起作用我在你写这里但是不工作codeigniter文件是在mathwork文件夹里面和mathwork文件夹里有admin文件夹在这个文件夹里有codeiniter文件和我使用REQUEST_URI –