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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:12:07+00:00 2026-06-09T09:12:07+00:00

Alright, so I’ve downloaded a CMS for a server I’m setting up and I

  • 0

Alright, so I’ve downloaded a CMS for a server I’m setting up and I have some difficulty with the path the files are on.

I have put the CMS in a subdirectory on my server as the root directory is already being used by another CMS. However, the CMS repeatedly uses “/” in the code to link to their files. For example, an image is found using this code:

<img src="/images/banner.png" />

As you know this will not work, because the link above redirects the request to the images folder in the root of the server, not the subdirectory. The CMS also came with a “.htaccess” file, so I immediately thought that I could redirect all requests made using the “/” character to the subdirectory on the server. This is the original “.htaccess” file:

RewriteEngine On

RewriteRule ^index.php(|/)$ content/.php
RewriteRule ^error.php(|/)$ content/error.php
RewriteRule ^housekeeping(|/)$ housekeeping/index.php
RewriteRule ^(|/)$ content/$1.php
RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ content/$1.php
RewriteRule ^rd/([^/]+)(|/)$ /rd.php?id=$1

RewriteRule ^quickregister/start(|/)$ /register/start.php
RewriteRule ^quickregister/step2(|/)$ /register/step2.php
RewriteRule ^quickregister/step3(|/)$ /register/complete.php

RewriteRule ^community/online(|/)$ content/online.php
RewriteRule ^community/vip(|/)$ content/vip.php
RewriteRule ^credits/goldvip(|/)$ content/goldvip.php

RewriteRule ^home/(..*)$ content/home.php?u=$1
RewriteRule ^articles/(..*)$ content/articles.php?story=$1

ErrorDocument 403 /content/error.php
ErrorDocument 404 /content/error.php

I thought that by adding

RewriteRule ^/$ /subdirectory/

the requests to “/” would be redirected, but to no avail. I have checked the apache configuration and it seems that overwriting the config using htaccess files is enabled, so if anyone is able to help me out I’d be very happy.

Thanks in advance!

EDIT:
I came real close to a solution. I inserted this code just below “RewriteEngine on”:

RewriteRule ^(.*)/(.*)$ /private_servers/strebbohotel/$2

This returned the following error page when visiting the url “http://mysite.com/private_servers/strebbohotel/content/.php&#8221;:
Not Found

The requested URL /private_servers/strebbohotel/.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

As you can see, it skips the “content” subdirectory for some reason. I believe it has something to do with the other lines of the .htaccess file but I can’t figure out which ones. It also could be that I need a more complex regex, but I’m not particularly good with it so if someone could help me further I’d be thankful.

  • 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-09T09:12:08+00:00Added an answer on June 9, 2026 at 9:12 am

    You have to change the .htaccess file on yout root directory – and that will mess with the other CMS. The only solution that comes to my mind is to use combination of RewriteCond’s:

    RewriteCond %{HTTP_REFERER} my_better_cms_url_regex
    RewriteCond %{REQUEST_URI} ^/images/.*$
    RewriteRule ^.*$ /subdirectory/%{REQUEST_URI}
    

    That should do the trick. If you want to customize it, refer to this cheatsheet (or simmilar). But be aware, that .htaccess in root directory is checked against ALL requests made to your subdir cms – therefore the need for second condition.

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

Sidebar

Related Questions

Alright, I have some questions... When you have a moment, can you take a
Alright so lets say I have these files in vendor/assets/javascript/ : modernizer.js lightbox.js highchart.js
Alright so I have recently made the decision to put every string in my
Alright so I have no idea how to even begin doing this But basically
Alright I created some custom classes for my project sourced from this tutorial ,
Alright so I have been looking around (on SO and Google) to see if
Alright, i have read many different views on how to do this with no
Alright guys, I have looked on the internet for ages and simply could not
Alright, here is my problem i'm trying to solve. I have an index page
Alright here is what I am attempting to do. I have a form written

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.