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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:06:52+00:00 2026-05-27T09:06:52+00:00

I am encountering a problem with a get parameter in conjunction with a htaccess

  • 0

I am encountering a problem with a get parameter in conjunction with a htaccess rewrite rule.
Below is the urlencode()’ed link; the rewrite rule I use to redirect to index.php, and lastly, a print_r($_GET) on the index.php.
As you can see, the urlescaped ampersand is not part of the value for variable static, but instead and contrary to my expectation gets interpreted as a variable seperator. Why?

Initial link:

<a href="static/Game-Tech-%26-Arts-Lab">link</a>

.htaccess:

RewriteRule ^static/(.*)$ /index.php?static=$1 [L]

index.php:

Array ( [static] => Game-Tech- [-Arts-Lab] => )
  • 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-27T09:06:53+00:00Added an answer on May 27, 2026 at 9:06 am

    Ah, okay. Interesting. It seems there is a special solution for keeping that ampersand specifically escaped. Use the [B] flag for Rewriterules.

    RewriteRule ^static/(.*)$ /index.php?static=$1 [L,B]
    

    This is supposed to urlencode special characters when interpolating the $1 placeholder. It only works with Apache 2.2 however I believe.

    Found a few references:

    • http://www.dracos.co.uk/code/apache-rewrite-problem/
    • mod_rewrite with question marks and ampersands (with PHP)
    • http://www.mediawiki.org/wiki/Manual:Short_URL/Ampersand_solution
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am encountering a problem with string formatting while trying to get only the
I'm trying to use Java Opencl from within jruby, but am encountering a problem
I am encountering a bug-like problem in Opera when trying the get the closed
I'm encountering this problem and I don't get why. I used the exact same
The problem i am encountering is that i cannot get my texture to render
I recently installed Ubuntu Jaunty and I'm encountering a problem when I try to
The problem I am encountering is that for my login form I have to
I´m encountering this problem trying to mock some objects that receive complex lambda expressions
I am encountering a problem when using LINQ in C#, I am constantly getting
Hello, it's really the first time for me to post. I'am encountering a problem

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.