Solved

htaccess

Posted on 2013-12-02
7
294 Views
Last Modified: 2013-12-19
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?
0
Comment
Question by:tweddlewalker
  • 3
  • 3
7 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 39692285
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. : )
0
 

Author Comment

by:tweddlewalker
ID: 39715921
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?
0
 
LVL 57

Expert Comment

by:giltjr
ID: 39716691
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?
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:tweddlewalker
ID: 39718893
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
0
 
LVL 57

Accepted Solution

by:
giltjr earned 500 total points
ID: 39719275
Still not sure what you mean by restricted.  You wanted to redirect to a new URL.

Is the redirection working?

As for the Internal Server error, what messages are you seeing in Apache's access and error logs?
0
 

Author Closing Comment

by:tweddlewalker
ID: 39730307
Thank you for your contribution
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now