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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:51:10+00:00 2026-05-23T13:51:10+00:00

I am trying to redirect all (dynamic)subdomains to a page with querystring but it’s

  • 0

I am trying to redirect all (dynamic)subdomains to a page with querystring but it’s giving page not found error.
Any ideas pls?
Eg. Would like something like

http://foo.example.com

to redirect to

http://www.example.com/pagefile.php?member_id=foo

I would appreciate if it retains the subdomain URL format.

# Make PHP code look like other code types
    AddType application/x-httpd-php .asp .py .pl


    <Files php.ini>
    order allow,deny
    deny from all
    </Files>

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(\w+)\.mivasite\.com [NC]
RewriteRule .* http://example.com/pagefile.php?member_id=$1
  • 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-23T13:51:10+00:00Added an answer on May 23, 2026 at 1:51 pm

    You’re mixing up the capture groups in your rewritecond and rewriterule. The matches in RewriteCond are stored in %1, %2, etc… while $1, $2 etc… are the captures from RewriteRule.

    You’re not doing any capturing in the RewriteRule, so $1 will be blank. Try doing

    RewriteRule .* http://mivasite.com/pagefile.php?member_id=%1
    

    instead. Of course, That probably won’t fix your 404 error, as this will merely fix up the query parameter. Check your server’s error log to see exactly what the URL was that produced the 404 error.

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

Sidebar

Related Questions

I'm trying to redirect all pages and subdomains by preceeding them with a m.
I'm trying to redirect all requests for a subdirectory and any files in it
I'm trying to redirect all links to a particular page on our site to
I am trying to redirect any and all requests to a certain directory, even
I have a basic splash page, and I am trying to redirect all urls
Hi I am trying to redirect all links to any pdf file in my
I'm trying to redirect to a page but based on the answer from a
I am trying to redirect ALL requests for mydomain.com whether they are something like:
I'm trying to redirect all subdirectories to the root of my website via .htaccess!
I am trying to write an iptables rule that will redirect all outgoing UDP

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.