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 8541435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:49:53+00:00 2026-06-11T11:49:53+00:00

I need to redirect some users, possibly to a subdomain, but I do not

  • 0

I need to redirect some users, possibly to a subdomain, but I do not want them to know that they are in a subdomain. They should think they are in the main domain.
I believe this can be done with htaccess, but it is gibberish to me.

Can someone please throw me some bones?

  • 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-11T11:49:54+00:00Added an answer on June 11, 2026 at 11:49 am

    When serving content from a different domain without redirecting the browser (thus changing the URL in the address bar) one of two things needs to happen. Either there is a file-path resolution to the other domain, or a reverse proxy must be set up (and it’s pretty easy to do if mod_proxy is loaded).

    It looks like you have your subdomain inside the document root of your main domain, which means this option will be viable. So if you want to it so when someone puts this URL in their address bar, http://domain.com/page, they get served the content in http://sub.domain.com/another-page, you’d simply add these rules to the top of the htaccess file in the document root of your main domain (public_html):

    RewriteEngine On
    RewriteRule ^page(.*)$ /subdomain_folder/another-page$1 [L]
    

    Otherwise, the second option is to use mod_proxy:

    RewriteEngine On
    RewriteRule ^page(.*)$ http://sub.domain.com/another-page$1 [L,P]
    

    EDIT:

    I want to redirect some users, depending on their ip (geographic location) to another subdomain. And yes public_html is the root

    You can check against the IP via the %{REMOTE_ADDR} variable:

    RewriteCond %{REMOTE_ADDR} ^123\.45\.67\.89$
    RewriteCond !^/subdomain_folder
    RewriteRule ^(.*)$ /subdomain_folder/$1 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Before anything, this is not necessarily a question.. But I really want to know
I need to do some checking on a validation control but I am not
I need to permanent redirect some pages, and redirect the user to the new
I need to redirect some of the older pages in my application to new
I need some advice on techniques to perform page redirect in asp.net. Which one
I need some help on mod rewrite 301 , to redirect my old website
I need to redirect users to the Change Password page if their password has
I need this logic to work: I want rewrite this string for users to
I need some help on the htaccess subdomain to be pointed to specific file
I need to pass user_id, not logged in user, but user_id from view. I

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.