无法访问url字符串我的代码中缺少什么



我遇到了一个问题,apache给了我一个"未找到";错误

场景:

我有一个表单的url-->10.17.10.19/webapps/api/index.php?url=身份验证

我想重写url的格式为-->10.17.10.19/webapps/api/auth

im使用Ubuntu 20.04 apache2

vhost:

<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>

htaccess:

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>

请帮助我更正条件以识别参数

我找到了答案我需要启用标头,这样htaccess才能工作
ae2enmod header

https://httpd.apache.org/docs/2.4/mod/

相关内容

  • 没有找到相关文章

最新更新