apache 请检查以下URL并确保其拼写正确,请求的URL:/icons/index. aspx

wz3gfoph  于 2022-12-04  发布在  Apache
关注(0)|答案(2)|浏览(208)

在开发服务器中运行一个项目运行完美,但我试图在一个活的服务器上移动,我得到“The requested URL /icons/create was not found on this server.”
我得到的只是在1路线在:.../icon/create,但任何路由都可以正常工作。

这是我的htaccess:

我尝试在本地执行composer dump-autoload,但未收到任何错误”
或者我的htaccess文件有问题?mod_rewrite已经在apache web服务器中启用了。
非常感谢,如果有人想帮助我:)

kx5bkwkv

kx5bkwkv1#

正如你说你已经**“mod_rewrite已经启用”**
尝试编辑/etc/apache2/sites-enabled/000-default/etc/apache2/apache2.conf

<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

AllowOverride None更改为AllowOverride All

tvz2xvvm

tvz2xvvm2#

/etc/apache2/mods-available/alias.conf中的注解别名。

<IfModule alias_module>
    # Aliases: Add here as many aliases as you need (with no limit). The format is
    # Alias fakename realname
    #
    # Note that if you include a trailing / on fakename then the server will
    # require it to be present in the URL.  So "/icons" isn't aliased in this
    # example, only "/icons/".  If the fakename is slash-terminated, then the
    # realname must also be slash terminated, and if the fakename omits the
    # trailing slash, the realname must also omit it.
    #
    # We include the /icons/ alias for FancyIndexed directory listings.  If
    # you do not use FancyIndexing, you may comment this out.

#   Alias /icons/ "/usr/share/apache2/icons/"

#   <Directory "/usr/share/apache2/icons">
#       Options FollowSymlinks
#       AllowOverride None
#       Require all granted
#   </Directory>

</IfModule>

在注解这些行之后,使用以下命令检查apache conf:

sudo apache2ctl -t

然后重新加载apache2:

sudo systemctl reload apache2

相关问题