2015-12-30 69 views
0

这里是我的.htaccess文件代码htaccess的URL重写不是在PHP修身框架工作

RewriteEngine On 
RewriteBase /api 

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule^index.php [QSA,L] 

文件路径

api/ 
    - htaccess 
    - index.php 

该网址工作正常

http://localhost/api/index.php/inventory/login/

http://localhost/api/inventory/login/显示404未找到错误。如何解决这个问题呢?

+0

http://stackoverflow.com/questions/14225283/how-to-remove-index- php-from-slim-framework-url –

+0

我试过,但它不工作。 @AmitRajput –

回答

0

添加 这在Apache的网站启用文件中<virtualHost>标签

<Directory "/var/www/html"> 
     AllowOverride All 
     Order allow,deny 
     Allow from all 
</Directory> 

.htaccess

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule^index.php [QSA,L]