Solved

htaccess

Posted on 2013-12-02
7
302 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

777 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