regex - 重定向到 htaccess 上的特定端口的规则
问题描述
如何指定将请求重定向到某个端口的规则?
这是我现有的.htaccess
文件。
# Enable rewrite engine and route requests to framework
RewriteEngine On
# Some servers require you to specify the `RewriteBase` directive
# In such cases, it should be the path (relative to the document root)
# containing this .htaccess file
#
# RewriteBase /
RewriteCond %{REQUEST_URI} \.ini$
RewriteRule \.ini$ - [R=404]
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
默认情况下,它被重定向到 80。
我尝试在文件中添加以下行:
RewriteRule ^.*$ "http\:\/\/127\.0\.0\.1\:2222%{REQUEST_URI}" [P,QSA,L]
我很容易与 .htaccess 规则混淆。
很感谢任何形式的帮助。
解决方案
推荐阅读
- linux - csh 等待命令输出到文件
- delphi - 乘法整数溢出 - 编译器错误?
- java - 私有访问说明符如何与 Guice 中的提供方法一起使用?
- javascript - Javascript无法将日期格式化为工作日后跟天
- javascript - 将现有列表中的标签动态添加到 Select2
- docker - 如何将 docker-compose 连接到容器网络和 localhost 网络
- excel - 查找一个值,然后使用下拉列表中的“是”或“否”修改右侧的单元格 4 列
- node.js - 从 node.js 发送电子邮件到 Gmail
- cdi - 动态 CDI 注入 @Named
- android - Flutter 将 Image 转换为 base64 和 base64 String 转换为 Image