Search code examples
symfonysymfony-3.4

All URLs go to web/index.html


Whatever the URL I used, I always go into the web/index.jtml file. I don't know why, so I don't really know which file I can show you.

I took the files from a production version of the website.

Here is my .htaccess

DirectoryIndex app.php

<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]

    # Sets the HTTP_AUTHORIZATION header removed by Apache
    RewriteCond %{HTTP:Authorization} .
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

    # If the requested filename exists, simply serve it.
    # We only want to let Apache serve files and not directories.
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ - [L]

    # Rewrite all other queries to the front controller.
    RewriteRule ^ %{ENV:BASE}/app.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        RedirectMatch 302 ^/$ /app.php/
    </IfModule>
</IfModule>

This is my security.yaml

security: encoders: AppBundle\Entity\User: algorithm: bcrypt

    providers:
        db_provider:
            entity:
                class: AppBundle:User
                property: username

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        #secured_api:
        #    anonymous: true
        #    stateless: true
        #    guard:
        #        authenticators:
        #            - AppBundle\Security\TokenAuthenticator
        main:
            anonymous: ~
            http_basic: ~
            form_login:
                login_path: login
                check_path: login
                default_target_path: graphic

            logout:
                path: /logout
                target: /login

Please let me know if there is a file I can show that can actually help, because I really don't know what's wrong here. I've just took the files from FTP, made a composer update, launch the server, then whatever the URL I try, whatever if she is mapped or not I always land on this website/index.html file.


Solution

  • In fact I had just forget to include the app_dev in the URL...my bad. Sorry for disturbing.