Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
app.php 隐藏在 url 中,如下所示:
重写引擎开启
#<IfModule mod_vhost_alias.c> # RewriteBase / #</IfModule> RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ app.php [QSA,L]
但在它之前,有:/symfony/web/
如何隐藏它?
更改您DocumentRoot的 Apache 配置以指向该web/目录。
DocumentRoot
web/
编辑/etc/httpd/conf/extra/httpd-vhost.conf(使用 Ubuntu 等其他发行版时,您的路径可能会有所不同):
/etc/httpd/conf/extra/httpd-vhost.conf
... <VirtualHost *:80> ... DocumentRoot /path/to/your/webapp/symfony/web <Directory /path/to/your/webapp/symfony/web> ... </Directory> </VirtualHost>