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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:53:24+00:00 2026-05-29T08:53:24+00:00

I have a localhost environment and a test server environment. I write all my

  • 0

I have a localhost environment and a test server environment. I write all my code locally and on occasion push the changes to the testing server. My code needs to be intelligent enough to know where it is being run so that it can call on appropriate url (local or test).

my local environment URL is “my.local” and test environment url is “test.somedomain.com”

I need to be able to set a baserewrite or something that adjusts itself according to the url the code is on.

Any help?

  • 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-05-29T08:53:26+00:00Added an answer on May 29, 2026 at 8:53 am

    If you have set up your virtualhost & DocumentRoot

    All you have to do for your documentroot is:

    RewriteBase /
    

    in your per directory .htaccess residing in your DocumentRoot.

    For other folders, you will have to set up an Alias(Context: server config, virtual host), a mod_alias directive.

    Example:

    Alias /xyz /abc/def

    And use RewriteBase directive in your per directory .htaccess
    Example from: RewriteBase:

    #  /abc/def/.htaccess -- per-dir config file for directory /abc/def
    #  Remember: /abc/def is the physical path of /xyz, i.e., the server
    #            has a 'Alias /xyz /abc/def' directive e.g.
    #
    
    RewriteEngine On
    
    #  let the server know that we were reached via /xyz and not
    #  via the physical path prefix /abc/def
    RewriteBase   /xyz
    
    #  now the rewriting rules
    RewriteRule   ^oldstuff\.html$  newstuff.html
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SOAP web-service I am testing locally in my development environment. I
In my bootstrap.php I have the following: if($_SERVER['SERVER_NAME'] == 'localhost') Kohana::$environment = 'development'; else
I have my Apache http server running on localhost:80 and restlet server on localhost:8182,
I have created login account on my localhost\sql2008 Server (Eg. User123) Mapped to Database
I have the following code: from selenium import selenium selenium = selenium(localhost, 4444, *chrome,
I have always been using virtualenv for testing my app in localhost since I
I have a local test/development server (HTTP, of course), listening to port 8000. I'm
i have two files:(localhost/template/) index.php template.php each time when i create an article(an article
For example I have site http://localhost/site In IIS I set that 404 error causes
I have strings like this: http://localhost:2055/web-site-2009/paginas/noticias/**IGP-M recua 0,36% em agosto, aponta FGV**-46.aspx I'd like

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.