domain.com/xyzにアクセスするとweb/がチェックインされ、web /に存在しない場合は、website /がチェックインされ、どちらにも存在しない場合はチェックインされるようにしたいと思います。 web/app.phpで
これを行うために(mod_rewriteを使用して)仮想ホストを構成するにはどうすればよいですか?
ありがとう
domain.com/xyzにアクセスするとweb/がチェックインされ、web /に存在しない場合は、website /がチェックインされ、どちらにも存在しない場合はチェックインされるようにしたいと思います。 web/app.phpで
これを行うために(mod_rewriteを使用して)仮想ホストを構成するにはどうすればよいですか?
ありがとう
これを仮想ホスト構成に追加してみてください。
RewriteEngine On
# check if it exists in /web
RewriteCond %{DOCUMENT_ROOT}/web%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}/web%{REQUEST_URI} -d
# if exists, serve the file in /web
RewriteRule ^(.*)$ /web$1 [L]
# check if it exists in /website
RewriteCond %{DOCUMENT_ROOT}/website%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}/website%{REQUEST_URI} -d
# if exists, serve the file in /website
RewriteRule ^(.*)$ /website$1 [L]
# otherwise, route through app.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/web
RewriteRule ^(.*)$ /web/app.php/$1 [L]
app.phpを経由するルートは、を呼び出すだけで/web/app.php
、スクリプトには何も送信しません。