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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:02:22+00:00 2026-05-26T08:02:22+00:00

I have an API server that I am working on it currently accepts requests

  • 0

I have an API server that I am working on it currently accepts requests through $_GET variables like below

http://localhost/request.php?method=get&action=query_users&id=1138ab9bce298fe35553827792794394&time=1319225314&signature=d2325dedc41bd3bb7dc3f7c4fd6f081d95af1000

I need help creating a HTaccess rule that can read urls that replace the ‘&’ with ‘/’ and also the ‘=’ and ‘?’ with ‘/’ to create a clean url like

http://localhost/request/method/get/action/query_users/id/1138ab9bce298fe35553827792794394/time/1319225314/signature/d2325dedc41bd3bb7dc3f7c4fd6f081d95af1000

Is there any way of doing this whilst still keeping the get parameters intact for the api to work from?

Also this is not the only request there are different requests that will be made.

Stackoverflow is always the place to go for expert advice so thanks in advance

  • 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-26T08:02:22+00:00Added an answer on May 26, 2026 at 8:02 am

    This tends to be my standard answer to this kind of question, but why are you trying to do this with .htaccess rules when you could just do it in request.php, and that would be much more maintainable. Just parse the value of $_SERVER['REQUEST_URI'] in your php script.

    //not really tested, treat as pseudocode
    //doesn't remove the base url
    $params = array();
    $parts = explode('/', $_SERVER['REQUEST_URI']);
    //skip through the segments by 2
    for($i = 0; $i < count($parts); $i = $i + 2){
      //first segment is the param name, second is the value 
      $params[$parts[$i]] = $parts[$i+1];
    }
    
    //and make it work with your exsisting code
    $_GET = $params;
    

    With that in place, you should be able to request:

    http://example.com/request.php/method/get/action/query_users/id/1138ab9bce298fe35553827792794394/time/1319225314/signature/d2325dedc41bd3bb7dc3f7c4fd6f081d95af1000
    

    Or use this simple .htaccess:

    RewriteRule ^request/ request.php
    

    And request:

    http://example.com/request/method/get/action/query_users/id/1138ab9bce298fe35553827792794394/time/1319225314/signature/d2325dedc41bd3bb7dc3f7c4fd6f081d95af1000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have (currently) working projects that use Javascript API to get the Facebook session
I have an API that is dependent on certain state information between requests. As
I have an API in the form of a JAR that I would like
I am currently trying to consume an API that is working fine in my
I have a domain foo.com on server bar. I have a subdomain api.foo.com which
I have an API consisting of ASP.NET webservices callable through GET/POST/SOAP. A new functionality
I have an API that can be implemented by various vendors. I can send
So Google Analytics does not have an API that we can use to get
I'm currently working on some .Net based software (.Net Framework 3.5 SP1) that integrates
I have two JSON objects here, generated through the Google Search API. The URL's

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.