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

The Archive Base Latest Questions

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

I was experimenting with mod-rewrite. I thought what I wanted was simple but I

  • 0

I was experimenting with mod-rewrite. I thought what I wanted was simple but I don’t get the requested file’s URI via REQUEST_URI. Rather the delived name is passed on.

The manual says:

THE_REQUEST

The full HTTP request
line sent by the browser to the server
(e.g., “GET /index.html HTTP/1.1”).
This does not include any additional
headers sent by the browser. This
value has not been unescaped
(decoded), unlike most other variables
below.

REQUEST_URI

The resource requested
in the HTTP request line. (In the
example above, this would be
“/index.html”.)

However the two give different file names in my tests. I have a bootstrap.php through which I wanted to send all requests. This is the test file:

<?php
echo $_GET['requestedURI'];
?>

on the .htaccess file I have:

### REWRITE RULES ###
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .+ bootstrap.php?requestedURI=%{REQUEST_URI} [L]

Requesting http://localhost/test.htm puts out: /bootstrap.php

if I put THE_REQUEST instead of REQUEST_URI in the .htaccess I get GET /test.htm HTTP/1.1

So why not settle for THE_REQUEST? Well, as soon as a query string exists things break. If I request: http://localhost/test.htm?x=1&y=2 I get GET /test.htm?x=1 the first ampersand breaks things. I think it should be possible to replace all ampersands in the querystring with %26 so that it would work but I did not manage so far…

So can anyone tell why REQUEST_URI fails and how to fix it or how to rewrite the ampersands to %26 in the query string?

Thanks.

EDIT: The above report applies to xampp 1.7.3 on Win 7. I tried it on a production Linux system in the meantime and there REQUEST_URI returns what it should.

  • 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:15:35+00:00Added an answer on May 22, 2026 at 3:15 am

    You don’t need to explicitly pass the requested URI path and query as you can access it in PHP via $_SERVER['REQUEST_URI']. Thus this should suffice:

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .+ bootstrap.php
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experimenting with Spring Mobile but I can't seem to get the basic example
I'm keen to get started experimenting with gzip, but like i used to find
I'm experimenting with some multithreading constructions, but somehow it seems that multithreading is not
im experimenting in getting camel to do some file operations and pass them through
I know, I would have thought the answer was obviously no as well, but
Experimenting with existential types. Seems to be a great way to get some type
Experimenting with Scala... I'm trying to define something analogous to the @ hack in
Experimenting with android game development. I'm using PNG format for images, and was wondering
While experimenting with pixel shaders in WPF I decided to draw some pixels onto
When experimenting with (embedded) Apache Derby DB, I noticed that a fresh database, with

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.