Solved

htaccess

Posted on 2013-12-02
7
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JQuery conflicts/syntax issue 4 31
How do I Enable submit button only if listbox has items 4 63
Anchor Bookmark 6 33
transfer content to new site design 7 49
Find out what you should include to make the best professional email signature for your organization.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

734 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