htaccess HTTPS重定向失败

时间:2016-11-11 19:03:51

标签: apache .htaccess redirect mod-rewrite

我的vhost.conf文件中有两个单独的查询,但两个都失败了,这是代码示例;

1:我希望能够从该域获取任何内容并检查其是否为http或https,然后将其重定向到重写规则

http://example.com/testing

由于某些奇怪的原因,它只适用于HTTP协议,因此重定向在RedirectMatch 301上正常工作。但是,我需要它也适用于https版本。

2:我有一些RewriteRule来重定向所有域上的catch。但是,它们似乎都没有起作用。问题:这是最好的方法还是应该使用RedirectMatch 301 ^(/superexample/?.*)$ http://www.superexample.com RedirectMatch 301 ^/enexample(/?.*)$ https://www.enexample.com

CREATE TABLE [dbo].[_Orders](
    [OrderNo] [varchar](13) NULL,
    [RowNo] [int] NULL,
    [Item] [varchar](16) NULL,
    [Qty] [float] NULL,
    [ItemType] [varchar](16) NULL,
    [OrderDate] [date] NULL
) ON [PRIMARY]


insert into _Orders(OrderNo, RowNo, Item, Qty, ItemType, OrderDate)
select '16-010-000001', 1, 'Item1', 2, 'Type1', '2016-11-11'
insert into _Orders(OrderNo, RowNo, Item, Qty, ItemType, OrderDate)
select '16-010-000001', 2, 'Item2', 21, 'Type1', '2016-11-11'
insert into _Orders(OrderNo, RowNo, Item, Qty, ItemType, OrderDate)
select '16-010-000001', 3, 'Item3', 2, 'Type2', '2016-11-11'
insert into _Orders(OrderNo, RowNo, Item, Qty, ItemType, OrderDate)
select '16-010-000002', 1, 'Item6', 10, 'Type2', '2016-11-15'
insert into _Orders(OrderNo, RowNo, Item, Qty, ItemType, OrderDate)
select '16-010-000002', 2, 'Item12', 5, 'Type1', '2016-11-15'
insert into _Orders(OrderNo, RowNo, Item, Qty, ItemType, OrderDate)
select '16-010-000003', 1, 'Item1', 3, 'Type1', '2016-11-12'
insert into _Orders(OrderNo, RowNo, Item, Qty, ItemType, OrderDate)
select '16-010-000004', 1, 'Item2', 7, 'Type1', '2016-11-23'
insert into _Orders(OrderNo, RowNo, Item, Qty, ItemType, OrderDate)
select '16-010-000005', 1, 'Item6', 2, 'Type2', '2016-11-25'
insert into _Orders(OrderNo, RowNo, Item, Qty, ItemType, OrderDate)
select '16-010-000005', 2, 'Item8', 2, 'Type1', '2016-11-25'

0 个答案:

没有答案