大家好,当我尝试在我的vps中使用app.php时收到此消息错误
Not Found
The requested URL /login was not found on this server.
.symfony的/ web中的.htaccess:
DirectoryIndex app.php
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{HTTP:Authorization} .
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^ %{ENV:BASE}/app.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
# When mod_rewrite is not available, we instruct a temporary redirect of
# the start page to the front controller explicitly so that the website
# and the generated links can still be used.
RedirectMatch 302 ^/$ /app.php/
# RedirectTemp cannot be used instead
</IfModule>
</IfModule>
和apache / site-available / 000-default.conf的这个conf:
<VirtualHost *:80>
# 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 0.0.0.0
ServerAdmin webmaster@localhost
DocumentRoot /var/www/PanelD/web
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
the
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
在服务器名称中只是一个例子,所以当我这样做时,我会得到404 Not Found for / login,我应该添加.htaccess使其运行。模式重写已在我的服务器中启用。当我尝试使用此URL访问时,效果很好
http://my.vps.url/app.php/login
但没有app.php无效 我有debian 9 apache2非常感谢您