Forum Discussion
Ashley_Penney_5
Nimbostratus
Oct 09, 2008http/https redirection based on URI
Hi,
I'm crafting two new irules, with the intention of keeping people https if the uri contains /secure/, and http if not. I know this is probably a terrible idea, but it's what I've b...
Ashley_Penney_5
Nimbostratus
Oct 09, 2008That's basically what we have, an example of a request to a page that would potentially appear in /secure/ would be like:
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /library/ask/index.html HTTP/1.1" 200 14651 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/btn.search.gif HTTP/1.1" 200 636 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bg.headerwrapper.gif HTTP/1.1" 200 53 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/logo.hls.gif HTTP/1.1" 200 1847 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bg.bodywrapper.gif HTTP/1.1" 200 1137 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bg.sectionnav.bot.gif HTTP/1.1" 200 3560 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bg.sectionnav.ul.gif HTTP/1.1" 200 51 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bg.sectionnav.top.gif HTTP/1.1" 200 543 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bullet.Me8e8e8.gif HTTP/1.1" 200 67 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bg.layoutwrapper.gif HTTP/1.1" 200 158 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/mainnav.matrix.gif HTTP/1.1" 200 14647 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bg.pagetitle.gif HTTP/1.1" 200 161 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bg.sectionnav.section.gif HTTP/1.1" 200 234 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/icon.offsite.gif HTTP/1.1" 200 70 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bg.sectionnav.page.gif HTTP/1.1" 200 77 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /img/bullet.txt.gif HTTP/1.1" 200 44 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /library/ask/3rdshootfemalestudent.jpg HTTP/1.1" 200 130904 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /images-cms/nav-images//active_library_nav_image4.png HTTP/1.1" 200 68427 "https://www.law.harvard.edu/library/ask/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:36:21 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:36:21 -0400] "GET /flash/sifr.lubalin-graph-book.swf HTTP/1.1" 200 82190 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
So in this case, I think what's tripping me up is how we're restricting things to content-type text, when I started testing with the rule you crafted, it did this:
Oct 9 15:43:13 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:43:13 -0400] "GET /library/ask/secure/index.html HTTP/1.1" 200 14651 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:43:13 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:43:13 -0400] "GET /css/print.css HTTP/1.1" 200 3607 "https://www.law.harvard.edu/library/ask/secure/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:43:13 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:43:13 -0400] "GET /css/combined.css HTTP/1.1" 200 55175 "https://www.law.harvard.edu/library/ask/secure/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
Oct 9 15:43:13 hlscrap vhost.www-ssl: www.law.harvard.edu 140.247.209.27 - - [09/Oct/2008:15:43:13 -0400] "GET /js/combined.js HTTP/1.1" 200 103397 "https://www.law.harvard.edu/library/ask/secure/index.html" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21"
So it seemed like, as requested, it got the text only bits. I'm going to do some testing and tweaking, I was having trouble finding documentation on the general concept of stream, I could only find specific examples for stuff like stream::enable.
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