現在、共有サーバーでSilex フレームワークを使用して Web サイトをホストしていますが、問題があります...
Silex は Symfony に似ており、/web/ サブフォルダーに app.php ファイルがあります。この Web サイトには、URL website.com/web/ からのみアクセスできます。共有サーバーなので仮想ホストを作成できないので、.htaccessファイルを使用するのが解決策だと思います...
website.com を website.com/web/ に自動的にリダイレクトできましたが、このオプションはあまり好きではありません。むしろ、website.com が直接 website.com/web/ を指すようにしたいのですが、.htaccess ファイルを使用してこれを行う方法がわかりません。私はこの問題を何時間も解決しようとしてきましたが、それは私を殺しています...
現時点では、このファイルを使用しています:
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ web/app.php [QSA,L]
</IfModule>
ただし、website.com から website.com/web にリダイレクトされるだけです。
とにかく、ルート URL が .htaccess ファイルを使用して /web フォルダーを直接指すようにすることはできますか?
どうもありがとうございました :)