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

  • Home
  • SEARCH
  • 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 3359774
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:54:49+00:00 2026-05-18T02:54:49+00:00

I would like to convert an absolute path into a relative path. This is

  • 0

I would like to convert an absolute path into a relative path.

This is what the current absolute code looks like

$sitefolder  = "/wmt/";
$adminfolder = "/wmt/admin/";

$site_path = $_SERVER["DOCUMENT_ROOT"]."$sitefolder";

// $site_path ="//winam/refiller/";

$admin_path = $site_path . "$adminfolder";

$site_url    = "http://".$_SERVER["HTTP_HOST"]."$sitefolder";
$admin_url   = $site_url . "$adminfolder";

$site_images = $site_url."images/"; 

so for example, the code above would give you a site url of

www.temiremi.com/wmt 

and accessing a file in that would give

www.temiremi.com/wmt/folder1.php

What I want to do is this I want to mask the temiremi.com/wmt and replace it with dolapo.com, so it would say www.dolapo.com/folder1.php

Is it possible to do that with relative path.

I’m a beginner coder. I paid someone to do something for me, but I want to get into doing it myself now.

  • 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-18T02:54:49+00:00Added an answer on May 18, 2026 at 2:54 am

    The problem is that your question, although it seems very specific, is missing some crucial details.

    If the script you posted is always being executed, and you always want it to go to delapo.com instead of temiremi.com, then all you would have to do is replace

    $site_url    = "http://".$_SERVER["HTTP_HOST"]."$sitefolder";
    

    with

    $site_url    = "http://www.delapo.com/$sitefolder";
    

    The $_SERVER["HTTP_HOST"] variable will return the domain for whatever site was requested. Therefore, if the user goes to www.temiremi.com/myscript.php (assuming that the script you posted is saved in a file called myscript.php) then $_SERVER["HTTP_HOST"] just returns www.temiremi.com.

    On the other hand, you may not always be redirecting to the same domain or you may want the script to be able to adapt easily to go to different domains without having to dig through layers of code in the future. If this is the case, then you will need a way to figuring out what domain you wish to link to.

    If you have a website hosted on temiremi.com but you want it to look like you are accessing from delapo.com, this is not an issue that can be resolved by PHP. You would have to have delapo.com redirect to temiremi.com or simply host on delapo.com in the first place.

    If the situation is the other way around and you want a website hosted on delapo.com but you want users to access temiremi.com, then simply re-writing links isn’t a sophisticated enough answer. This strategy would redirect the user to the other domain when they clicked the link. Instead you would need to have a proxy set up to forward the information. Proxy scripts vary in complexity, but the simplest one would be something like:

    <?php
        $site = file_get_contents("http://www.delapo.com/$sitefolder");
        echo $site;
    ?>
    

    So you see, we really need a little more information on why you need this script and its intended purpose in order to assist you.

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

Sidebar

Related Questions

I would like to convert a relative path to an absolute path. How is
How can you convert a drive relative path such as D:test.xml into an absolute
i would like convert xml, that: tag is the name of current node (this,
I'd like to have a standard function that will convert relative paths into absolute
I would like convert the below text into a nested array, something like you
I would like to convert the following string into an array/nested array and iterate
I would like to convert this piece of logic with purely matrix operations instead
I would like to convert a yyyy-mm-dd to something like this: Saturday, 2 October
I would like to convert my BitmapImage to a System.Drawing.Image ? This is my
I would like to convert a binary number writen in a String into its

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.