Forum Discussion
page redirection...
Hi All,
Currently if we type www.jobcredits.com in browser it will take me to https://www.jobcredits.com when I try https://jobcredits.com it will opening page https://jobcredits.com
My requirement is if I type https:// jobcredits.com also it should take me to https://www.jobcredits.com
can this be achieved ? please let me know what irule I need to add to achive this requirement.
3 Replies
- The_Bhattman
Nimbostratus
Hi vvskalandhar,
Take a look a the following link
https://devcentral.f5.com/questions/redirect-https-to-https-www
I hope this helps
- StephanManthey
Nacreous
Hi wskalandhar,
the iRule needs to be extended a bit:when HTTP_REQUEST { if { not ([string tolower [HTTP::host]] starts_with "www") } { HTTP::redirect https://www.[getfield [HTTP::host] ":" 1][HTTP::uri] } else { HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] } }Thanks, Stephan
- Arie
Altostratus
To take advantage of client-side caching (eliminating the redirect response for people who have already visited the site) and for SEO-reasons I would recommend sending a 301 instead of a 302:
HTTP::respond 301 Location "https://www.[getfield [HTTP::host] ":" 1][HTTP::uri]"
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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