以下是我们解决它的方法:
在 /etc/httpd 的 conf.d 目录中: 文件:application.conf
Alias /application/debug /var/www/symfony/application/debug/
Alias /application/dev /var/www/symfony/application/dev/
Alias /application/test /var/www/symfony/application/test/
Alias /application /var/www/symfony/application/web/
<Directory "/var/www/symfony/application/web">
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /application/app.php [QSA,L]
</IfModule>
</Directory>
<Directory "/var/www/symfony/application/debug/">
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /application/debug/debug.php [QSA,L]
</IfModule>
</Directory>
<Directory "/var/www/symfony/application/dev/">
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /application/dev/dev.php [QSA,L]
</IfModule>
</Directory>
<Directory "/var/www/symfony/application/test/">
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /application/test/test.php [QSA,L]
</IfModule>
</Directory>
然后在根应用程序目录中
ln -s web test
ln -s web debug
ln -s web dev
然后在应用程序/网络中
根据您的需要制作自定义的 test.php、debug.php 或 dev.php(我们已在我们的商店中将 app_dev.php 重命名为 dev.php)。