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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:10:10+00:00 2026-06-17T19:10:10+00:00

Basically, I have a directory /website.com/ that contains an index.php . What usually happens

  • 0

Basically, I have a directory /website.com/ that contains an index.php.

What usually happens is that I have an htaccess file that redirects the URL to the index, so something like

domain.com/api/

Would load

domain.com/index.php?uri=api/

But now say, instead of having a sub-directory, I want to use a sub-domain, like:

api.domain.com

Would run:

domain.com/index.php?uri=api/

My current approach almost works. My htaccess file looks like:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^api
RewriteRule ^(.*)$ index.php?uri=api/$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?uri=$1 [L,QSA]

Which works fine for the URL part. But the problem comes in when I’m trying to load an image.

Basically, instead of loading from the base directory, it’s appending the directory onto the URL.

So when I request an image on api.domain.com/v1/ it’s trying to load the image from

domain.com/v1/image.png

rather than

domain.com/image.png

Does anyone know how to fix this issue?

  • 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-17T19:10:11+00:00Added an answer on June 17, 2026 at 7:10 pm

    The solution I think I found was to use absolute URL’s rather than relative ones when including the image (in my CSS).

    So rather than

    background:url(background.png);
    

    I used

    background:url(http://domain.com/background.png);
    

    Not my ideal solution but it is a workaround. If someone has a better way to solve my problem, I will gladly use.

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

Sidebar

Related Questions

Basically I have a website that lists out the files in the directory above
Basically, I have a script that cannot see an existing directory on the OS
I basically have a program that filters records from one excel file to another
So I am creating a website that I want to have an admin directory
Basically, I have a very simple website where the root directory looks like: /images/
I'm building the basic framework for my website and I have a config.php file
I basically have three tables, posts, images and postimages (this simply contains the ids
I basically have 7 select statements that I need to have the results output
We have our own web server hosting our website that is open to the
I have a website that's sending out confirmation emails. When I send an email

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.