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

  • Home
  • SEARCH
  • 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 9193377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:08:53+00:00 2026-06-17T21:08:53+00:00

When the URL /page1.php?abc is requested, I want it redirected to /page1.php?xyz instead. Specifically,

  • 0

When the URL /page1.php?abc is requested, I want it redirected to /page1.php?xyz instead.

Specifically, this is what I want to tell the client:

HTTP/1.1 301 Moved Permanently
Location: /page1.php?xyz

I’ve tried Apache RedirectMatch directive, but it doesn’t seem to support query strings.

Is there another directive which supports HTTP-redirect for URLs with query strings?

Currently I’m accomplishing this using PHP’s header function, but this feels like a stopgap hack so I’m looking for an Apache solution.

  • 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-17T21:08:54+00:00Added an answer on June 17, 2026 at 9:08 pm

    You can use mod_rewrite for this. If this module is available you use these rules (must be placed inside /.htaccess):

    RewriteEngine on
    RewriteCond %{QUERY_STRING} ="abc"
    RewriteRule ^page1\.php$ /page1.php?xyz [R=301,L]
    

    There is a PHP-only solution too:

    if ($_SERVER["QUERY_STRING"] == "abc") {
        header("Location: /page1.php?xyz", true, 301);
        die;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a URL formatted like this: http://testsite1/mm/page1.php?tID=18&tSerial=TEST TT 1 And here is my
Given: Url - http://www.contoso.com/search.php?q= {param} returns: -html- --body- {...} ---div id='foo'- ----div id='page1'/- ----div
i have a url www.abc.com/index.php?page/Secure and i want to access it with www.abc.com/secure im
I have this code: $('#page-refresh').click( function() { $.ajax({ url: /page1.php, cache: false, dataType: html,
$_GET variable shows empty on the URL www.abc.com/ec/basket.php?product_id=1 . This is very surprising as
I am given a page url like 'http://abc.com/test.php?a=1&b=2&c=3' . Now I have been told
I have this jQuery script var dataString = class_id=+class_id; $.ajax({ type: POST, url: page.php,
I have this jQuery code: $(document).ready(function() { $.ajax({ url: pages/+page+.php, cache: false }).done(function( html
YouTube has URL's like these: http://www.youtube.com/watch?v=zKqeCtjFGFc When I create a PHP page mine would
I have several jQuery .ajax calls on the same page like: $.ajax({ url: page1.php,

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.