About
Pricing
Community
Teams
Start Free Trial
Log in
tweddlewalker
asked on
12/2/2013
htaccess
Want to use .htaccess to:
1. redirect specific and mutiple ip adresses
2. from http://www.mysite.com
3 to http://www.subsite.mysite.com/newpage.php
Efforts with RewriteCond... end in failure
Could anyone please help?
HTML
Apache Web Server
6
1
Last Comment
tweddlewalker
8/22/2022 - Mon
giltjr
12/3/2013
Not sure but the following should rewrite a request with no URI (that is just plain /) from a host with the IP address of 123.45.67.8
RewriteCond %{REQUEST_URI} ^\/
RewriteCond %{REMOTE_ADDR} 123\.45\.67\.9
RewriteRule /(.*) http://www.subsite.mysite.com/newpage.php
It MIGHT put you in a loop so be careful. : )
tweddlewalker
12/12/2013
ASKER
Sorry for the delay in replying to your suggestion; thank you for it. I have been away.
Access is certainly restricted but we get an Internal Server Error message. Any thoughts?
giltjr
12/13/2013
Not sure what you mean by "access is certainly restricted."
What type of error?
Do you happen to have PHP or some other service side scripting language installed?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
tweddlewalker
12/14/2013
ASKER
1. that access is restricted to the site from that ip address
2. the message is "Internal Server Error"
3. no; the htaccess file is as recommended
ASKER CERTIFIED SOLUTION
giltjr
12/14/2013
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
tweddlewalker
12/19/2013
ASKER
Thank you for your contribution
RewriteCond %{REQUEST_URI} ^\/
RewriteCond %{REMOTE_ADDR} 123\.45\.67\.9
RewriteRule /(.*) http://www.subsite.mysite.com/newpage.php
It MIGHT put you in a loop so be careful. : )