Redirecting from IP address to domian name...
8 posts
• Page 1 of 1
Redirecting from IP address to domian name...
Hello,
I need to rewrite links coming in with IP address instead of domain name,
from: http://999.999.999.999/product/category/item.aspx
to: http://www.domain.com/product/category/item.aspx
Are there any code samples anywhere for this scenario?
Any one could help with syntax?
Thanks in advance.
I need to rewrite links coming in with IP address instead of domain name,
from: http://999.999.999.999/product/category/item.aspx
to: http://www.domain.com/product/category/item.aspx
Are there any code samples anywhere for this scenario?
Any one could help with syntax?
Thanks in advance.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Redirecting from IP address to domian name...
Hello,
Please, try uing the following:
The idea is take from Examples Section under "Moving site location" - http://www.helicontech.com/isapi_rewrit ... amples.htm
Regards
Andrew
Please, try uing the following:
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP:Host} ^999\.999\.999\.999$ [NC]
RewriteRule (.*) http://www.domain.com/$1 [NC,R=301,L]
The idea is take from Examples Section under "Moving site location" - http://www.helicontech.com/isapi_rewrit ... amples.htm
Regards
Andrew
Re: Redirecting from IP address to domian name...
Thank you Andrew,
I tried that, but it only works on root folders ;
Will redirect from;
http://999.999.999.999/item.aspx
Will not redirect from;
http://999.999.999.999/product/category/item.aspx
I tried that, but it only works on root folders ;
Will redirect from;
http://999.999.999.999/item.aspx
Will not redirect from;
http://999.999.999.999/product/category/item.aspx
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Redirecting from IP address to domian name...
Does it keep 999.999.999.999?
Also, the rule is written to redirect ALL requests. If it doesn't, please, inspect your rules and find the one that prevents from redirecting.
Regards
Andrew
Also, the rule is written to redirect ALL requests. If it doesn't, please, inspect your rules and find the one that prevents from redirecting.
Regards
Andrew
Re: Redirecting from IP address to domian name...
Yes it does keep the ip address.
This is the only rule I have.
This is the only rule I have.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Redirecting from IP address to domian name...
This means we are doing something wrong.
Please, try to make logging work and see what rewrite.log says. The logging issues are desribed here - http://www.helicontech.com/forum/10648-FAQ.html
Regards
Andrew
Please, try to make logging work and see what rewrite.log says. The logging issues are desribed here - http://www.helicontech.com/forum/10648-FAQ.html
Regards
Andrew
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Redirecting from IP address to domian name...
Sure, please, use email or helpdesk. And please, specify the reference to this topic.
Regards
Andrew
Regards
Andrew
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 10 guests