404 return, when Setup .htaccess in fuel php

吃可爱长大的小学妹 提交于 2020-01-06 20:08:13

问题


i'm having problem when i want to install fule php in my pc, the problem is when i'm setup .htaccess i'm get 404 page not found, i have setup modrewrite in apache it's OK.

this is my .htaccess file

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteBase /public

    RewriteRule ^(/)?$ index.php/$1 [L]

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

    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

i'm place my code in directory htdocs/myproject.

this is path of myproject directory

  myproject/
  .htaccess
  fuel/
    app/
    core/
    packages/
  public/
    assets/
    index.php
  oil

i don't now what happen i just following this step but i don't get the right result.


回答1:


from the link you give

In that case, you need an additional .htaccess file that you need to place in your document root, which will redirect requests to the site root to your public folder, and also modifies the rewrites to include the public folder:

so you need to have a htacess file in your myproject folder

something like this in the htaccess file

RewriteRule ^(.*)$ public/$1 [L]



回答2:


i can solve with change htaccess like this...thanks zvaya..you help me ..

<IfModule mod_rewrite.c>
        RewriteEngine on

        RewriteBase /myproject/public

        RewriteRule ^(/)?$ index.php/$1 [L]

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

        RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>


来源:https://stackoverflow.com/questions/10809570/404-return-when-setup-htaccess-in-fuel-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!