Forum Discussion
Tobias_Neumeyer
Nimbostratus
Jun 25, 2009SharePoint http to https link replacing
Hi,
hope some of the expert can help with my issue.
We're trying to setup SharePoint 2007 in Host Header mode with SSL and BIG-IP LTM SSL offloading.
On some sites the links in sharepoint are still http instead https. Now I have found a iRule for SharePoint 2003 which should solve these problems.
when HTTP_REQUEST {
Based on the Social Security and credit card scrubber
Don't allow data to be chunked
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
when HTTP_RESPONSE {
Only check responses that are a text content type
(text/html, text/xml, text/plain, etc).
if { [HTTP::header "Content-Type"] starts_with "text/" } {
Get the content length so we can request the data to be
processed in the HTTP_RESPONSE_DATA event.
if { [HTTP::header exists "Content-Length"] } {
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 4294967295
}
if { $content_length > 0 } {
HTTP::collect $content_length
}
}
}
when HTTP_RESPONSE_DATA {
if { [regsub -all "http://site1.sharepoint.domain.com" [HTTP::payload] "https://site1.sharepoint.domain.com" newdata] } {
HTTP::payload replace 0 [HTTP::payload length] $newdata
}
}
This iRule is working and it replace the http links with https in general.
But pages with matching http links looking a little bit strange.
Some text on the site have special funny characters suddenly with the iRule. The text looks like this....
"Using SQL Server Database Mirroring with Office SharePoint® Server and Windows® SharePointÂ"
Does anybody know what the problem could be and how can I resolve this?
The other problem is, that we need a global rule for all of our sites. At the moment the regsub method replacing a special http://fqdn only.
Waht I need is something like that
if { [regsub -all "http://*.sharepoint.domain.com" [HTTP::payload] "https://*.sharepoint.domain.com" newdata] }
I have tried it with diffrent expressions but I can't get to work.
Hope someone can help me?
Thank you in advance
Tobias
- hoolio
Cirrostratus
Hi Tobias, - Tobias_Neumeyer
Nimbostratus
Hi Aaron, - hoolio
Cirrostratus
So you see the match in STREAM_MATCHED, but no replacements are done in the payload? Maybe some of the references to http:// in the payload are in mixed case? If so, you could use a stream expression of:
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects