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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:07:20+00:00 2026-06-09T19:07:20+00:00

I have moved site from one framework to another and now I would like

  • 0

I have moved site from one framework to another and now I would like to redirect important pages (around 20). How to redirect them using apache rewrite? Here are examples:

Old: http://mydomain.com/ba/stream.php?kat=15
New: http://www.mydomain.com/bs/about-us/our-partners

Old: http://mydomain.com/ba/stream.php?kat=29
New: http://www.mydomain.com/bs/catalogues/it-catalogue

Also, after important pages are listed, I’d like to redirect all remaining links in form:

http://mydomain.com/ba/whatever-is-here

to

http://www.mydomain.com/bs/

Following TerryE’s suggestion, I’ll attach my latest code which is not working 🙂

RewriteCond %{QUERY_STRING} ^kat=15$
RewriteRule ^stream\.php$ http://www.mydomain.com/bs/about-us/our-partners [R=301,L]

One more note: I use this code to redirect root domain to www subdomain:

RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]

I have placed this root to www code below code for specific pages redirection, and when I test http://mydomain.com/ba/stream.php?kat=15 in browser, I am redirected to http://www.mydomain.com/bs/ba/stream.php?kat=15

  • 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-09T19:07:21+00:00Added an answer on June 9, 2026 at 7:07 pm

    Adnan,

    You need to add the following lines to your DOCROOT/.htaccess. This assumes that you don’t have any .htaccess file in your ba subdirectory. (See Tips for debugging .htaccess rewrite for an explanation of why.)

    RewriteEngine On
    RewriteBase   /
    #
    # Redirect kat 15 to the Partners page 
    #
    RewriteCond %{QUERY_STRING}   ^kat=15$
    RewriteRule ^ba/stream\.php$  http://www.mydomain.com/bs/about-us/our-partners? [R=301,L]
    #
    # Redirect all other kat ids to the corresponding bs page 
    #
    RewriteCond %{QUERY_STRING}   ^kat=(\d+)$
    RewriteRule ^ba/stream\.php$  http://www.mydomain.com/bs/%1? [R=301,L]
    

    Note:

    • the rule matches against the UPI less the leading path (in this case /)
    • you need to have the trailing ? on the replacement string to suppress the existing query parameters.
    • the %n parameters pick up the match variables from the last successful condition match.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have moved my drupal site from one mysql server to another one. Old
I have moved a web site from one server to another and I copied
I have moved my iPhone app from one machine to another. In the process
At some point I must have moved files from one location to another using
We have recently moved some data from an SQL Database instance to another one
I have just moved a site from a dedicated server to a GoDaddy shared
I have just moved a site from a Windows 2003, IIS6 SQL 2005 server
I've moved my django application from one server to another, and spotted strange bug
I have just moved an old classic ASP site from a win2003 IIS6 box
I've just moved over from my own MVC framework to a community supported one

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.