所有請求都會通過文件web/app.php(類似於index.php),例如對主頁的請求 - adwords-up.com/web/app.php,input - adwords-up.com /web/app.php/login。我想從鏈接中刪除部分web/app.php。在配置.htaccess中,重定向到默認的web/app.php,以便這樣的請求是主要格式 - http://adwords-up.com/和Page login - http://adwords-up.com/login。刪除參考的web/app.php。 Symfony2
還有就是我/etc/apache2/sites-available/adwords-up.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port t$
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName adwords-up
ServerAdmin [email protected]
DocumentRoot /var/www/adwords-up/web
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
它不工作:\ – 2014-10-06 11:03:47
你有'在Apache中啓用mod_rewrite'? – 2014-10-06 11:04:38
是的。 'var_dump(in_array('mod_rewrite',apache_get_modules()));'布爾真正 – 2014-10-06 12:22:11