0

Web プロジェクトで Laravel を使用しています。認証されていないユーザーに対してこれらのルートを指定しました。

Route::group(array("before" => "guest"), function() {
    // Show the login page for the user
    Route::get("/", array("as" => "homepage", function() {
        return View::make("unauthenticated.login");
    }));

    Route::get("/account/login", array("as" => "account-login-get", function() {
        return View::make("unauthenticated.login");
    }));
});

私のページにアクセスする/と、正しいように見えます。にアクセスしようとすると/account/login、スタイルシートが取得できません。これは書き直しが関係していると思います。Windows Server 2012 で IIS を使用しており、パブリック フォルダーにこの種の web.config ファイルがあります。

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Move to index.php">
                    <match url=".*" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:0}" logRewrittenUrl="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

私は2つのプロジェクトを持っています。そのうちの 1 つでこれは機能しますが、もう 1 つは機能しません。何が問題なのですか?

4

1 に答える 1

1

を使用URL::asset()してスタイルシートにリンクします。/その中には(たとえば)にリンクされているため、 にいるexample.com/css/style.css 場合は/account/loginexample.com/account/login/css/style.css

<link rel="stylesheet" href="{{ URL::asset('css/style.min.css') }}"/>マスター ブレード テンプレートで使用します。

それが役に立てば幸い

于 2014-01-25T20:11:20.897 に答える