Forum Discussion
Nlepore_67643
Nimbostratus
Jan 25, 2013Having issues with redirect
I'm trying to redirect certin pages to https, based on URI in a class.
Looks to be working for the default.aspx page, but not the others.
when HTTP_REQUEST {
...
Arie
Altostratus
Jan 25, 2013- Any errors in the log?
- Redirecting based on a URI that contains /default.aspx is risky, is it is quite conceivable that you'll have a path like /products/default.aspx sooner or later.
I'd recommend using "starts_with".
In addition, I'd use HTTP::path instead of HTTP::uri to check the request, as there's always a risk that a developer (or .NET) includes a path in a query string. - Is it really necessary to redirect from "/" to "/default.aspx"? From a web hosting perspective you'll want to avoid people visiting the default page of a folder by name.
- If you're redirecting the home page to HTTPS it would make sense to do that right away, rather than redirecting to /default.aspx on port 80 first and then to port 443.
- Instead of using HTTP::redirect you may want to consider using HTTP::respond with response code 301, since those are cached by clients and 302s are not. (Be sure to disable your own browser cache during development and troubleshooting, though!)
- What happens if you go directly to /default.aspx? Do you get redirected?
- What does Fiddler show?
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