First of all, i'm new to FuelPHP, so it will be something very easy but i can't find the answer on the internet so i'm hoping that you guys can help me.

The thing is that i'm following THIS tutorial about FuelPHP.

I've setup wamp with an virtial directory in D:\www_ander\webshop. That is the root with the .htaccess and the index.php and the folder assets

I've got the fuel folder in the folder www_ander.

I've did what the tutorial said ( Edit the config / autoload, create the files and database ) with the following command ( i ran this in command promt from the folder D:\www_ander )

php oil generate scaffold messages name:string message:text
php oil refine migrate

I don't get any errors, and the database is created succesfully. But when i go to my website (this is localhost, i've edidted the host file of windows ):

http://webshop.nl/messages/

I get an 404, Not Found page. I even tryed it with /index/ appended to the URL, but that didn't work also.

So my question is, what did i wrong? Why isn't this working as it should?!? Is my URL wrong or is it another issue?

Mayby inrellevant, but here is the .htaccess file:

# Multiple Environment config, set this to development, staging or production
# SetEnv FUEL_ENV production

<IfModule mod_rewrite.c>

    # Make sure directory listing is disabled
    Options +FollowSymLinks -Indexes
    RewriteEngine on

    # NOTICE: If you get a 404 play with combinations of the following commented out lines
    #AllowOverride All
    #RewriteBase /wherever/fuel/is

    # Restrict your site to only one domain
    # !important USE ONLY ONE OPTION

    # Option 1: To rewrite "www.domain.com -> domain.com" uncomment the following lines.
    #RewriteCond %{HTTPS} !=on
    #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    #RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    # Option 2: To rewrite "domain.com -> www.domain.com" uncomment the following lines.
    #RewriteCond %{HTTPS} !=on
    #RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
    #RewriteCond %{HTTP_HOST} (.+)$ [NC]
    #RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]

    # Remove index.php from URL
    RewriteCond %{HTTP:X-Requested-With}    !^XMLHttpRequest$
    RewriteCond %{THE_REQUEST}              ^[^/]*/index\.php [NC]
    RewriteRule ^index\.php(.*)$            $1 [R=301,NS,L]

    # Send request via index.php (again, not if its a real file or folder)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # deal with php5-cgi first
    <IfModule mod_fcgid.c>
        RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
    </IfModule>

    <IfModule !mod_fcgid.c>

        # for normal Apache installations
        <IfModule mod_php5.c>
            RewriteRule ^(.*)$ index.php/$1 [L]
        </IfModule>

        # for Apache FGCI installations
        <IfModule !mod_php5.c>
            RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
        </IfModule>

    </IfModule>

</IfModule>

------ UPDATE ------

I'm still looking for the answer, but i've already found an workaround. When i visit http://webshop.nl/index.php/messages/ it does work. So it seems like the .htaccess isn't fully working. But as far as i see, it should work. So do you guys know what could be wrong?

有帮助吗?

解决方案

I've figured out what the problem was. Id had to do with my virtual host setup.

The thing is that i didn't specify to allow overides. So after i inserted this part in my virtual host file, it worked:

<Directory "D:\www_ander">
    AllowOverride All
</Directory>

So the whole virtual host file now looks like this:

<Directory D:\www_ander\>
    Order Deny,Allow   
    Allow from all 
</Directory>

<VirtualHost *:80>   
    DocumentRoot "D:\www_ander" 
    ServerName webshop.nl
    ServerAlias www.webshop.nl
    <Directory "D:\www_ander">
        AllowOverride All
    </Directory>
</VirtualHost>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top