【发布时间】:2022-10-24 09:22:42
【问题描述】:
我有一个 apache 问题,给我一个“未找到”错误。
设想:
我有一个形式的 url --> 10.17.10.19/webapps/api/index.php?url=auth
我想重写表单中的url --> 10.17.10.19/webapps/api/auth
我正在使用 Ubuntu 20.04 apache2
虚拟主机:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
访问:
RewriteEngine On
Options All -Indexes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
apache.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes
# FollowSymLinks
# AllowOverride None
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
请帮我纠正条件以识别参数
【问题讨论】:
-
我已经启用 aen2mod 重写但仍然无法正常工作
-
该分布式配置文件(“.htaccess”)位于何处?
-
/var/www/html/webapps/api/.htaccess
-
为什么
DocumentRoot /var/www/html/和<Directory /var/www/>之间存在差异? -
登陆页面和目录的文档根是我们设置规则的时候吗?两种不同的东西
标签: apache .htaccess ubuntu url vhosts