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

The Archive Base Latest Questions

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

I want to convert this url: module-apple-get.html?term=st to file.php?module=apple&func=get&term=st I ‘ve wrote this code

  • 0

I want to convert this url:

module-apple-get.html?term=st

to

file.php?module=apple&func=get&term=st

I ‘ve wrote this code in .htaccess file:

RewriteRule ^module-apple-get\.html?term=([^-]+)$ file.php?module=apple&func=get&term=$1 [L,NC,NS]

but it doesn’t work.is it wrong?

  • 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:27:30+00:00Added an answer on May 23, 2026 at 1:27 pm

    The RewriteRule directive doe not work with query string directly therefore your rule will never work.

    Here are few approaches.

    1) This will do the rewrite if /module-apple-get.html is requested and will append existing query string to the new URL. This means, that if you request /module-apple-get.html?term=st&some=another_param it will be rewritten to file.php?module=apple&func=get&term=st&some=another_param. This is a safer and recommended approach.

    RewriteRule ^module-apple-get\.html$ file.php?module=apple&func=get [QSA,L]
    

    2) Another approach is to ONLY rewrite if requested URL has term=st PRESENT:

    RewriteCond %{QUERY_STRING} (^|&)term=st
    RewriteRule ^module-apple-get\.html$ file.php?module=apple&func=get&term=st [L]
    

    This will rewrite if you request /module-apple-get.html?term=st but will do NOTHING if you request /module-apple-get.html?some=another_param.

    3) Yet another approach is to ONLY rewrite if WHOLE requested URL matches:

    RewriteCond %{QUERY_STRING} ^term=st$
    RewriteRule ^module-apple-get\.html$ file.php?module=apple&func=get&term=st [L]
    

    This will rewrite if you request /module-apple-get.html?term=st but will do NOTHING if you request /module-apple-get.html?term=st&some=another_param.

    P.S.

    1. You can add any other flags if required ([NC], [NS] etc).
    2. You may need to add leading slash / before file.php (depends on your setup, where this .htaccess is located etc)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this HTML structure and want to convert it to an accordion. <div
I want to convert function object to function. I wrote this code, but it
I want to convert this hello@domain.com to &#104;&#101;&#108;&#108;&#111;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046;&#099;&#111;&#109; I have tried: url_encode($string) this provides
I have URLs like this: .com/topic.php?id=6 I can convert them to this: .com/topic/5.html This
I have a URL like this http://subdomain.domain.com/xyz-200_some_information I want to convert this URL to
I have a html table.I want to convert this into a datatable. What is
I want to convert local html file on iPhone to PDF document. I have
I want to convert a primitive to a string, and I tried: myInt.toString(); This
I want to convert the following PHP operation to C# code, could anyone please
Based on this answer Get the subdomain from a URL , I am trying

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.