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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:16:56+00:00 2026-05-11T10:16:56+00:00

I have 2 subdomains which use the same rules, as seen below: <Directory /srv/project/sites/project.hu/htdocs/>

  • 0

I have 2 subdomains which use the same rules, as seen below:

<Directory /srv/project/sites/project.hu/htdocs/>     RewriteEngine On     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule ^(.*)\?*$ index.php?route=$1 [L,QSA]     SetEnv config default,local     Order allow,deny     allow from 192.168.0.0/16 </Directory>  <Directory /srv/project/sites/admin.project.hu/htdocs/>     RewriteEngine On     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule ^(.*)\?*$ index.php?route=$1 [L,QSA]     SetEnv config default,local     Order allow,deny     allow from 192.168.0.0/16 </Directory> 

As you can see the rules are the same in both containers. How can I specify these rules in a single container? At first I thought about using this:

<DirectoryMatch ^/srv/project/sites/(?:(?:admin\.project\.hu)|project\.hu)/htdocs/$>  ... </DirectoryMatch> 

But isn’t there a way to do this in a more clean way that I’m missing?

Edit: I dislike the DirectoryMatch way, because when when I’ll have more directories, the regex will grow unmaintainable.

  • 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. 2026-05-11T10:16:57+00:00Added an answer on May 11, 2026 at 10:16 am

    put the rewrite rules into a separate file, eg. rewrite.conf, and include it like so

    <Directory /srv/project/sites/project.hu/htdocs/>   Include rewrite.conf </Directory>  <Directory /srv/project/sites/admin.project.hu/htdocs/>   Include rewrite.conf </Directory> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a number of subdomains, which are using crossdomain.xml file and I'm looking
I have website which works fine and have following in the htaccess file RewriteEngine
I have a website(for example: test.com), which has 2 kinds of subdomains: test.com static_${version}.test.com
I have 3 subdomains , which are based on Opencart. What I need to
I have a domain foo.com on server bar. I have a subdomain api.foo.com which
I have a domain name: TestSite.com. I create several subdomains for this site and
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'
I want to share my session variables in PHP using many subdomains. I have
tl;dr I am considering a webservice design model which consist of several services/subdomains, each
I have a site which uses ssl when accessing a subdomain which essentially is

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.