Forum Discussion
iRule, Redirect "SEARCH ENGINE FRIENDLY"
Hi We have already Redirects in place which all work as expected. Our Marketing told us now that one Redirect isn't "SEARCH ENGINE FRIENDLY"
They checked it on the following Website: http://www.webconfs.com/redirect-check.php
the Redirect itself ist working. It seems that the Problem exist if the Domain afterwards is still the same. Or is the Problem because we just Change the host and Keep the uri? How can we solve this Problem? any Ideas?
NOT Working: when HTTP_REQUEST { if { [HTTP::host] contains "www.domain1.ch" } { HTTP::redirect http://www.domain1.ch[HTTP::uri] } }
The error message we get is: php_network_getaddresses: getaddrinfo failed: Name or service not known (0) Either http://domain.com is NOT REDIRECTING to any URL or the redirect is NOT SEARCH ENGINE FRIENDLY
Working: when HTTP_REQUEST { if { [HTTP::host] contains "www.domain1.ch" } { HTTP::redirect http://www.domain2.com/de/solutions[HTTP::uri] } }
The message we get here is: Found redirect to http://www.domain1/de/solutions/. The Redirect is Search Engine Friendly
5 Replies
- Thomas_Gobet
Nimbostratus
With this irule you're going to redirect requests everytime.
It's going to make a redirect loop because your redirect host also contains "www.domain1.ch".Have you got something else which can be use as condition ?
- aschi
Nimbostratus
Sorry, i made a copy/pase error because I changed the original hostname. It's redirectiong from domain1.ch to www.domain1.ch when HTTP_REQUEST { if { [HTTP::host] contains "domain1.ch" } { HTTP::redirect http://www.domain1.ch[HTTP::uri] } }
I also tried another Rule which also works great where no Hostname is needed: when HTTP_REQUEST {
if { !([string tolower [HTTP::host]] starts_with "www.") } {
HTTP::redirect http://www.[HTTP::host][HTTP::uri]"
}
}But the I still get the message: Not search engine friendly.
- Thomas_Gobet
Nimbostratus
The problem is the same.
Try to replace contains by equals it should work. - aschi
Nimbostratus
Hi Thank you for answer but it didn't work. I get the same message back :-( Other ideas are appreciated. Regards, roger
- Thomas_Gobet
Nimbostratus
Hi,
I read a second time your last modification on your iRule and it appears to me that you've change something in it.
Can you try this iRule :
when HTTP_REQUEST { if { [HTTP::host] equals "domain1.ch" } { HTTP::redirect http://www.domain1.ch[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
