我想将每个可能的网址组合重定向到单个路径。
例如。
http:/example.com ---> HTTPS:/example.com/abc/cde
https:/example.com - > HTTPS:/example.com/abc/cde
http:/example.com/abc/cde - > HTTPS:/example.com/abc/cde
我可以通过以下mod_rewrite设置处理1和3的情况但是无法执行2重定向可以帮助。
为了避免链接转换,我在网站示例中进行了一次转义。
RewriteEngine On
RewriteCond%{HTTPS} off
RewriteCond%{HTTP:X-Forwarded-Proto}!https
RewriteRule ^(。*)$ https://% {HTTP_HOST}%{REQUEST_URI} [R = 301,L]
答案 0 :(得分:1)
您应该使用 RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
重写标记
- (void) validateFormWithCompletion: (void(^)(BOOL valid)) completion
{
if (! [NetworkConstant appIsConnected])
{
[[AppThemeManager sharedInstance] showNoInternetMessage];
completion(NO);
}
emailIdTF.text = [emailIdTF.text trimWhiteSpaceAndNextLine];
if (emailIdTF.text.length == 0)
{
[[AppThemeManager sharedInstance] showNotificationWithTitle:@"Incomplete" subtitle:@"Please fill in a valid email id" duration:durationForTSMessage withTypeOfNotification:notificationWarning];
completion(NO);
}
else
{
completion(YES);
}
}