小编Big*_*767的帖子

如果包含至少一个大写,Apache 将所有 URL 重写为小写

我一直试图让 Apache 将所有包含大写字符的 URL 重写为小写。由于某种原因,我发现的所有解决方案都不适用于我的情况。我希望这里有人可以帮助我找出原因。

我想要的是,如果有人点击我们页面上的一个 URL,那么http://example.com/products/productID/1234 他们就会被发送到 http://example.com/products/productid/1234 。注意 ID 是小写的。它并不总是只是ID我想要任何大写字符转换为小写。

基本上我访问的任何 URL 都不会改变,这让我相信它甚至没有试图重写它们。我也验证了rewrite_module未注释。

我在这里尝试了答案:Convert and redirect URL in largecase to lowercase using .htaccess

原始httpd.conf的摘录

<VirtualHost *:80>
  ServerName dev.xxxxxxx.com
  DirectoryIndex default.cfm index.cfm index.htm index.html
  DocumentRoot "Z:/XXXXX"
  ServerAdmin technical@xxxxxxxxx.com

  Redirect 301 /xxxxxxxxx/photoFiles https://www.xxxxxxxxx.com/xxxxxxxx/photoFiles
  ProxyPreserveHost On
  # ProxyPassMatch .*\.(jpg|png|gif|css|js|ico|htm|txt|csv|html|pdf|doc|docx|xls|xlsx)$ !
  # ProxyPass / balancer://nodes/ stickysession=JSESSIONID|jsessionid scolonpathdelim=on
  ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://dev.xxxxxxxx.com:7009/$1$2
  # ErrorDocument 404 /errors/404.cfm
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

更新(非工作)httpd.conf 的证书

<VirtualHost *:80>
  ServerName dev.xxxxxxx.com
  DirectoryIndex default.cfm index.cfm index.htm index.html …
Run Code Online (Sandbox Code Playgroud)

mod-rewrite httpd httpd.conf apache-2.2 apache-2.4

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

apache-2.2 ×1

apache-2.4 ×1

httpd ×1

httpd.conf ×1

mod-rewrite ×1