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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:04:49+00:00 2026-05-31T05:04:49+00:00

Ive got a website in a subdirectory but all the image, link and CSS

  • 0

Ive got a website in a subdirectory but all the image, link and CSS paths are set like this:

“/images/error.png”
or “/help.html”
or “/css/styles/stylesheet.css”

I’ve tried a million different .htaccess things and tried setting the base href tag to the domain.com/subfolder.

I can’t seem to get anything to work!

Also: There are hundreds of files in this system so I can’t manually go and change all the paths to relative.

  • 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-31T05:04:50+00:00Added an answer on May 31, 2026 at 5:04 am

    When you wrote: Ive got a website in a subdirectory I am assuming that you moved all images, css etc to subdirectory as well.

    If that is so you can manage it using a simple RewriteRule. Create a .htaccess under DOCUMENT_ROOT with this code:

    Options +FollowSymLinks -MultiViews
    # Turn mod_rewrite on
    RewriteEngine On
    RewriteBase /
    
    # If the request is for a valid directory
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    # If the request is for a valid file
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    # if this is a link
    RewriteCond %{REQUEST_FILENAME} -l
    # forward to subdirectory if it is not already subdirectory
    RewriteRule ^((?!subdirectory/).*)$ subdirectory/$1 [L,NC]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive got images on my website. I would like to create functionality that if
I've got a website which has a layout sorta like this: <html xml:lang=en xmlns=http://www.w3.org/1999/xhtml
Ive got the following code which I hacked together from website examples. It works
I've got a new website moved to my server. This website uses PHP and
Ive just built a website for a client, and Ive got an odd problem
I've got a website that is currently all in English. It is an online
I've got a website where URLs are rewritten in this format: http://www.example.co.uk/module/page/query/ http://www.example.co.uk/index.php?m=module&p=page&q=query Which
Using ASP.NET and Windows Stack. Purpose: Ive got a website that takes in over
here is the case: ive got 2 lists on my website. country and region.
Ive got a contact form that isnt sending but is outputting that the message

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.