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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:13:02+00:00 2026-05-28T13:13:02+00:00

I have a php file, for example www.example.com/folder/test.php The file above (test.php) has the

  • 0

I have a php file, for example www.example.com/folder/test.php

The file above (test.php) has the line

include($_SERVER['DOCUMENT_ROOT'].$page);

$page = /folder2/.$directory1./.$directory2./.index.php

$directory1 and $directory2 are all random.

However,

The index page has an image on it that just references the image as the source.

For Example src=”image.bmp”

So what happens is the image’s url actually shows up like this…
www.example.com/folder/image.bmp

And it should show up like this…
www.example.com/folder2/.$directory1./.$directory2./image.bmp

Is there a way to fix this besides using absolute paths?
There are millions of directories and we would like to correct the issue rather than correct the problem (even though we will do both).

Can I place an htaccess file in the directory its looking for the image in to redirect it?

FROM: www.example.com/folder/

TO: www.example.com/folder2/.$directory1./.$directory2./

  • 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-28T13:13:03+00:00Added an answer on May 28, 2026 at 1:13 pm

    If you want to do that, you should either dynamically change the .htaccess or specify in it any possible $directory1/$directory2 combination. In my opinion, the best way to do this is to change the src of that image in the file index.php to something like:

    <img src="/folder2/<?php echo $directory1; ?>/<?php echo $directory2; ?>" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP file located in a folder (www.mysite.com/folder/test.php) which accepts a get
I have a file with .php extention www.example.com/thefile.php?name=123 that I want to direct the
I have a PHP file, Test.php, and it has two functions: <?php echo displayInfo();
I've got a number of users, each with the website page like http://www.mysite.com/folder/artist_id.php?id=33 The
Someone from our team change the permalink of a page to http://www.example.com/ so this
I have a directory /public_html/myfolder/ and I want my domain www.example.com to point to
I have 3 different domains, www.example.com, www.mywebsite.com, www.domain.com. In my server, I have 3
2 of my urls, for example www.abc.com and www.def.com point to the same .php
so suppose my server is located in http://www.example.com I then put a file file.exe
i have this file that is on the root folder called sumbit.php and when

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.