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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:40:35+00:00 2026-05-27T01:40:35+00:00

My problem: I want to have a rewriteRule that allows me to forward parameter

  • 0

My problem: I want to have a rewriteRule that allows me to forward parameter to another directory on my server. I called a subdomain of my page and this subdomain should points on the “normal” directory of my root page. Addional to that the rule should add a parameter to all url’s that will be called.

Example:

Root-Page: http://www.example.com -> directory on the server /srv/www/vhosts/example.com/httpdocs/

Subdomain: http://fb.example.come 

Now the Root-Page and the Subdomain should point to the same directory:

Subdomain -> directory on the server /srv/www/vhosts/example.com/httpdocs/

The difference between both domains is a paramenter that should add to every URL call:

User-Call: http://fb.example.com/index.php
--> add a fb=1 param
Intern -> http://fb.example.com/index.php?fb=1

User-Call: http://fb.example.com/show.php?param=1&test=1
--> add a fb=1 param
Intern -> http://fb.example.com/show.php?fb=1&param=1&test=1

There should always be a param called “fb=1” in the URL.

How can i realize this?

  • 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-27T01:40:36+00:00Added an answer on May 27, 2026 at 1:40 am
    RewriteCond %{QUERY_STRING} !fb=1
    RewriteCond %{HTTP_HOST} ^fb\.
    RewriteRule (.*) $1?fb=1 [QSA]
    

    But I would just put some code in your php to detect the fb.example.com domain. Much cleaner

    if($_SERVER["HTTP_HOST"]=="fb.example.com")
      $fb = true;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

with my RCP program I have the problem that I want to have more
My problem is that I want to have a tab bar view with its
I have this rewrite rule that turns foo.com/test (or foo.com/test/) into foo.com/test.txt: RewriteRule ^test/?$
I have a database that has a url colomn like this-is-the-title.php I want to
I have exactly the same problem treated in this topic . That's: I have
I have a little Java problem I want to translate to Python. Therefor I
The Problem I want to press a key when I have a line highlighted
I have a small problem with a script. I want to have a default
I have a simple, real life problem I want to solve using an OO
I have a small problem where I want to find the next active item

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.