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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:49:51+00:00 2026-05-27T03:49:51+00:00

The Setup My setup is to have resources shared for two or more sites

  • 0

The Setup

My setup is to have resources shared for two or more sites that have similar structures though different content. In example…

http:// localhost/site1/

http:// localhost/site2/

There are two types of rewrites, CMS content (pretty much just content that is echoed out to the page) and special modules (e.g. blog software module) where I have software that goes in to more specific handling of content from the database.

So the first rewrite rule for the blog makes sure that the blog module handles blog requests….

http:// localhost/site1/blog/*

http:// localhost/site2/blog/*

…using the blog module software located at…

http:// localhost/blog/

The CMS rewrite rule is intended to handle non-specific module requests…

http:// localhost/site1/*

http:// localhost/site2/my_page.html*

…using the CMS rewrite software located at…

http:// localhost/rewrite.php

The Problem

The blog module and CMS module rewrites are conflicting. I’ve attempted to make an exception using the following rule. Here is my code…

RewriteEngine on
RewriteCond %{REQUEST_URI} !\.js$
RewriteRule .*/blog(.+) blog$1 [QSA]
RewriteRule !.*/(admin|blog|forums)(.+)$ rewrite.php

The last rule doesn’t actually work. With this code if I access..

http:// localhost/site1/blog/*

http:// localhost/site2/blog/*

…any blog (or admin or forums) URL for any site is still being rewritten to work with localhost/rewrite.php.

So how do I adjust the last rule to meet the following conditions please…

1.) The first directory (site1 or site2 in localhost/site1/blog) remains dynamic so I can add a third site if I want without having to readjust the code for any reason in that regard.

2.) That the blog (or admin or forums) index (e.g. blog/, forums/, admin/) are handled by their own modules as well as anything inside of those directories (e.g. admin/1, admin/test.html) regardless of HTTP code, 200, 404, etc.

3.) Any URL that is not in the last rule’s exception list is handled by rewrite.php (regardless of HTTP code, 200, 404, etc).

4.) localhost/site1/blog/ is not handled by rewrite.php and localhost/site1/random_path is not handled by the blog module rewrite.

I’ll be happy to quickly reply with any further clarifications.

  • 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-27T03:49:51+00:00Added an answer on May 27, 2026 at 3:49 am

    Thanks to an earlier RewriteCond someone wrote that made sense I adapted it and it worked great!

    Note if someone decides to use this code that the conditions apparently only work AFTER the specific rewrite rules for the modules (admin, blog, forums) though BEFORE the CMS rewrite.php rule.

    I’ll be happy to honor any positive critiques.

    RewriteEngine on
    RewriteCond %{REQUEST_URI} !\.(css|js|zip)$
    
    RewriteRule .*/admin(.+) admin$1 [QSA]
    RewriteRule .*/blog(.+) blog$1 [QSA]
    RewriteRule .*/forums(.+) forums$1 [QSA]
    
    #individual...
    RewriteCond %{REQUEST_URI} !.*/admin
    RewriteCond %{REQUEST_URI} !.*/blog
    RewriteCond %{REQUEST_URI} !.*/forums
    
    #condensed...
    RewriteCond %{REQUEST_URI} !.*/(admin|blog|forums)
    
    RewriteRule !\.(css|js|zip)$ rewrite.php
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Setup My setup is to have resources shared for two or more sites
I have two django sites that use the same database and share some of
Setup I have a website that draws RSS feeds and displays them on the
Setup: I have a COM DLL that calls a method inside a managed C#
I have a site that is hosted in shared hosting environment. They use a
I have a client/server type application setup, similar to a bittorrent downloading program. However,
I have a table setup as follows: +---------------+ | resources | +---------------+ | id
I have setup a model structure which allows different models to associate with a
I have a TabActivity that has a TabHost with two tabs. Each tab has
So basically I have two models, Entry and Comment. I have the association setup

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.