Forum Discussion
mel_59881
Nimbostratus
Jun 19, 2007rewrite .com to .org
First, great site! Good design, good answers.
My problem: I need an iRule to rewrite .com requests to .org requests so my certs will not give a warning page. The url is www.mysite.org, but people frequently enter www.mysite.com which we have a dns entry for so it works, but when they try to access secure pages, they get a warning page.
I think what I want to do is the following:
when HTTP_REQUEST {
if { [HTTP::host] contains "mysite.com" }
{ HTTP::header replace "Host" "mysite.org" }
}
I'm an iRules noob, and I don't have a setup to test this before going live, so if anyone can give me a thumbs up or show me where I went wrong, I'd really appreciate it.
Thanks!
mel
- dennypayne
Employee
Why not just redirect anyone that hits .com to .org? Then you don't have to worry about subsequent connections to .com.when HTTP_REQUEST { if { [HTTP::host] contains "mysite.com" } { HTTP::redirect http://www.mysite.org } }
- Deb_Allen_18Historic F5 AccountI'd say definitely put Denny's iRule in place on the port 80 virtual to redirect those beginning @ an http URL and minimize the likelihood of warnings overall.
- mel_59881
Nimbostratus
Thanks Denny. It's working.
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