私はSymfonyアプリを持っていて、サブディレクトリ/ブログにWordpressを実行したい。 Wordpressのインストールは、Symfonyのwebフォルダではなく、独自のディレクトリにあります。Wordpressのブログ、symfonyのアプリ - Apache Aliasの設定
Wordpressはindex.phpファイルを実行せず、myweb.com/blogに行くと、すべてのwordpressフォルダファイルのリストを含む "Index Of"ページが表示されます。
これは私のバーチャルホストの設定ファイルである:VAR/WWW /ウェブ/ mywordpress
:WordpressのアプリがであるVAR/WWW /ウェブ/ myweb:symfonyのアプリがである
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName www.myweb.com
DocumentRoot "/var/www/webs/myweb/web"
DirectoryIndex app.php
<Directory "/var/www/webs/myweb/web">
AllowOverride None
Allow from All
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/blog(/.+)? [NC]
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
</Directory>
Alias "/blog/" "/var/www/webs/mywordpress"
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 5
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE "application/atom+xml" \
"application/javascript" \
"application/json" \
"application/rss+xml" \
"application/x-javascript" \
"application/xhtml+xml" \
"application/xml" \
"image/svg+xml" \
"text/css" \
"text/html" \
"text/javascript" \
"text/plain" \
"text/xml"
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
ExpiresActive On
ExpiresByType image/x-icon "now plus 1 month"
ExpiresByType image/gif "access 1 month"
ExpiresByType image/jpg "access 1 month"
ExpiresByType image/jpeg "access 1 month"
ExpiresByType image/png "access 1 month"
ExpiresByType text/css "access 1 month"
ExpiresByType text/js "access 1 week"
ExpiresByType application/javascript "access 1 week"
</IfModule>
SSLCertificateFile /etc/letsencrypt/live/www.myweb.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.myweb.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
ワードプレスhtaccessファイルは、次のとおりです。
Options -Indexes
DirectoryIndex index.php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
私が間違ってやっているの任意のアイデア?どうもありがとう。