Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8549127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:39:15+00:00 2026-06-11T13:39:15+00:00

I’ve created a .htaccess file to redirect a specific IP address to another file:

  • 0

I’ve created a .htaccess file to redirect a specific IP address to another file:

# Allow rewriting of htaccess
RewriteEngine On
RewriteBase /

# Get remote address/block of addresses to redirect
RewriteCond %{REMOTE_ADDR} 127\.0\.0\.1

# Define the file being accessed
RewriteCond %{REQUEST_URI} /index\.php$

# When the remote address(es) try to access the file above redirect them to the file below
RewriteRule .* /other-index\.php [R,L]

This works well and the above redirects localhost to other-index.php if it tries to access index.php but allows all other remote hosts to access index.php.

The remote host is calling: http://www.example.com/index.php

My question is can the remote host (in this case localhost) find out that it is being redirected by the server?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:39:16+00:00Added an answer on June 11, 2026 at 1:39 pm

    My question is can the remote host (in this case localhost) find out that it is being redirected by the server?

    Yes because the client (at 127.0.0.1) makes a request for /index.php to the server. The server responds with a 302 redirecting the client to a different location /other-index.php.

    Normally this all happens seemlessly, like if you are using a browser. The browser gets the new location (/other-index.php) and simply makes a new request to the server for the new location and gets it. It happens instantly. But the remote host (the client) knows it’s being redirected because the first request it made (for /index.php) resulted in a 302 with a new location (/other-index.php).

    If the R flag in the square brackets of your RewriteRule was omitted, there wouldn’t be a redirect and the URI would be internally re-written by the server, and the client (the remote host) would be oblivious to the fact that was served the content at other-index.php when it requested other.php.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.