【问题标题】:My .htaccess not working on my ubuntu server我的 .htaccess 在我的 ubuntu 服务器上不起作用
【发布时间】:2018-07-30 11:13:55
【问题描述】:

我正在 ubuntu 服务器下开发我的 Web 应用程序。我想覆盖或隐藏我的 index.php。我正在尝试访问 html GET 方法请。帮助,我怎么无法识别我的错误。谢谢!

<.ht>

RewriteEngine On
RewriteRule ^([^/]+)/? index.php?url=$1 [L,QSA]

From this - http://192.168.2.60/api/index.php?url=auth
To this - http://192.168.2.60/api/auth

错误消息:>

未找到 在此服务器上找不到请求的 URL /api/auth。

Apache/2.4.18 (Ubuntu) 服务器位于 192.168.2.60 端口 80

【问题讨论】:

  • 旁注:“从这个”和“到这个”是相反的。它将 从 api/auth 重写为 index.php?url=$1
  • .htaccess 位于哪个文件夹中?根?或/api?
  • /api/.htaccess

标签: php .htaccess


【解决方案1】:

我已经搜索了多个可能的答案来解决。这篇文章帮助我处理我的 .htaccess。我只需要在 /var/www/ 上启用覆盖。这是一个可能对你们有帮助的链接!

Enabling .htaccess file to rewrite path

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-05-17
    • 2016-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多