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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:27:09+00:00 2026-06-04T06:27:09+00:00

I have an app that serves many sites and I am using Apache mod-rewrite

  • 0

I have an app that serves many sites and I am using Apache mod-rewrite to map the
url’s like this

http://site1.net/controller
http://site2.net/controller2/another_view
http://site3.net/
http://special_case.net/

maps to:

index.php?url=http://site1.net/controller
index.php?url=http://site2.net/controller2/another_view
index.php?url=http://site3.net/
index.php?url=http://special_case.net/hub

My rewrite rules are:

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

Which handles all the cases except the special last case, where I need to force
the use of a controller called “hub” when handling a specific domain. I collaborate with others on this project which means I can’t do anything about the routing once the index file is called.

Can someone fix my rules so that all the above cases resolve?

  • 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-04T06:27:16+00:00Added an answer on June 4, 2026 at 6:27 am

    You current rules don’t seem to add the hostname to the url get-parameter. So I added that to to the following:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    
    RewriteCond %{HTTP_HOST} ^(special_case\.net)$
    RewriteRule ^(.*)$ index.php?url=http://%1/hub/$1 [QSA,L]
    
    RewriteCond %{HTTP_HOST} ^(.*)$
    RewriteRule ^(.*)$ index.php?url=http://%1/$1 [QSA,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small app that downloads some files from a remote (HTTP) server
we have an APP, that uses many local resources, such as windows printing API,
I have a large (as in many pages, objects...) asp.net web app that pegs
I am using the standard outputcache tag in my MVC app. i have this
I have a written C++ server app that I would like to be able
I have an app that shows a series of UIImageView s on a ScrollView
I have an app that downloads some documents from a server and saves them
I currently have an app that requires connection to a server in multiple activities.
I have a flex app that is hosted on my server. It runs off
I have a GWT app that makes an RPC call to a server to

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.