所有URL转到网/ index.html的

问题描述 投票:0回答:2

无论我用的网址,我总是去到web / index.html文件。我不知道为什么,所以我真的不知道哪些文件,我可以告诉你。

我从网站上的生产版本了的文件。

这里是我的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>

这是我的security.yaml

安全性:编码器:的appbundle \实体\用户:算法: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

请让我知道如果有一个文件,我可以证明,实际上可以帮助,因为我真的不知道什么是错在这里。我只是把文件从FTP,制成acomposer更新,启动服务器,那么无论该URL我试试,不管她是否被映射或者不是一直在这个网站/ index.html文件降落。

谢谢你的帮助。

symfony symfony-3.4
2个回答
0
投票

改变你的.htaccess吧

RewriteEngine On
RewriteRule ^(.*)$ web/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]

0
投票

其实我刚刚忘了,包括在URL ......我的坏app_dev。对不起打扰。

© www.soinside.com 2019 - 2024. All rights reserved.