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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:32:11+00:00 2026-05-22T03:32:11+00:00

I need to rewrite a URL using an .htaccess and the URL has two

  • 0

I need to rewrite a URL using an .htaccess and the URL has two query strings. Here is my raw URL:

http://domain.com/channel-partners/en/index.php?location=phoenix-az&name=company

How do I get that to be written as:

http://cp.domain.com/phoenix-az/company
  • 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-22T03:32:11+00:00Added an answer on May 22, 2026 at 3:32 am
    RewriteEngine On
    RewriteBase /
    
    RewriteRule ^partners/([\w-]+)/([\w-]+)/?$ channel-partners/en/index.php?location=$1&name=$2 [L]
    

    This will redirect URLs in the format partners/location/name with an optional trailing slash to the raw URL you provided. location and name can be alphanumeric, underscore, or dash characters.

    Note: I have prefixed the URL with the literal partners. Without it your RewriteRule would be too loose and match nearly all requests. Feel free to change it.

    UPDATE

    To redirect from your sub-domain, the above needs to be in the .htaccess file for cp.domain.com. You’ll need to modify your RewriteRule to the following:

    RewriteRule ^partners/([\w-]+)/([\w-]+)/?$ http://domain.com/channel-partners/en/index.php?location=$1&name=$2 [L]
    

    However, I really don’t recommend this. Link management is going to be a nightmare. You should really try to have all these links under the same domain. 301 Redirect from the sub-domain if you have to.

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

Sidebar

Related Questions

I need help to redirect the following URL (in htaccess) http:www.domain.com/article/the-bp-oil-spill-one-year-later/19918396/20110420/ To http:www.domain.com/article/the-bp-oil-spill-one-year-later/19918396/2011/04/20/ my
I need to provide a static url to a client, eg. http://domain.com/video.mp4 . However
I need to rewrite url with rule like below RewriteRule ^files/([a-z0-9-\.]+)$ files/domain.com/$1 domain.com is
Using a .htaccess rewrite rule, I need to add ?q= before the path on
I've got a url type:- http://www.example.com/products.php?cat=1 which I am able to rewrite to:- http://www.example.com/myproduct1
i have a url like this http://example.com/blog/photos/photos/gallery/image/1 . And i need to remove the
I need to rewrite any url on my domain that starts with **/club/***anyPage* to
I need some help with .htaccess . I've been using URL rewrites, but not
I need some help with an url.rewrite-if-not-file. I am using a Zend Framework based
I'm using .NET MVC 2 If an incoming request contains the URL: http://something.com/1234 where

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.