apache 从 url 中删除第一个 /

apache 从 url 中删除第一个 /

例如,https://subdom.mysite.com/contact_us/-->https://subdom.mysite.comcontact_us/

这些是我唯一拥有的重写规则:

RewriteEngine On
RewriteBase   /
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*)$ /#/$1 [L]

一些背景知识:我正在使用 apache webserver 来托管 angularjs 1.6 web 应用程序。更改最后两行似乎会破坏 webapp,因为我无法再重新加载页面。

我读了这个问题,但他们的问题源于 http url,而这里的情况并非如此。

以下是服务器日志:

[2019 年 8 月 13 日星期二 18:20:18.897503] [suexec:notice] [pid 1] AH01232:已启用 suEXEC 机制(包装器:/usr/sbin/suexec)
[2019 年 8 月 13 日星期二 18:20:18.924270] [lbmethod_heartbeat:notice] [pid 1] AH02282:没有来自 mod_heartmonitor 的 slotmem
[2019 年 8 月 13 日星期二 18:20:18.938867] [mpm_prefork:notice] [pid 1] AH00163:已配置 Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.0.33 - 正在恢复正常操作
[2019 年 8 月 13 日星期二18:20:18.938916 2019] [core:notice] [pid 1] AH00094:命令行:'/usr/sbin/httpd -D FOREGROUND'
--[13/Aug/2019:18:20:43 +0000]“GET /contact_us HTTP/1.1”302 357
[13/Aug/2019:18:20:43 +0000] TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384“GET /contact_us HTTP/1.1”357
--[13/Aug/2019:18:20:46 +0000]“GET /contact_us HTTP/1.1”302 228

相关内容