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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:19:31+00:00 2026-05-29T05:19:31+00:00

I have the setup below; a very simple URL rewrite setup with a test

  • 0

I have the setup below; a very simple URL rewrite setup with a test setup

// ----- test.php -----
<?php

phpinfo();
// ----- test.php -----

The config for test.local is as below.

<VirtualHost *:80>
        ServerName test
        ServerAlias test.*
        DocumentRoot /var/www/test
</VirtualHost>

<Directory "/var/www/test/">
        RewriteEngine On
        RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule .* test.php/$0 [R,NE]
</Directory>

Now if I make a request GET http://test.local/my-path-info the default phpinfo() page appears as expected, if I add slash in the path info, that works too. But if I add an encoded forward slash %2F into the URL (example GET http://test.local/my-path-info%2fsomething-else), it comes up as 404 Not found. Basically it doesn’t get to the php file.

Any idea why this is happening, and how to get around it?

The setup is on Apache 2.2.13, PHP 5.3.8 on Linux (Centos 5.x).

NOTE: What I am trying to do here is to add a forward slash into one of the path-info components, such that it doesn’t get interpreted by the router logic in an MVC framework. Without encoding it, the router cannot differentiate between a slash that is a path separator and the one that is part of a path component.

  • 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-29T05:19:32+00:00Added an answer on May 29, 2026 at 5:19 am

    Because of the apache version that doesnt support NoDecode as an option for AllowEncodedSlashes, I ended up using the below combination. I also had to double url-encode the request URI. Not ideal but works for me for the moment.

    <VirtualHost *:80>
            ServerName test
            ServerAlias test.*
            DocumentRoot /var/www/test
            AllowEncodedSlashes On
    </VirtualHost>
    
    <Directory "/var/www/test/">
            RewriteEngine On
            RewriteBase /
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
    
            # Option B below was the key!
            RewriteRule .* test.php/$0 [R,NE,B]
    </Directory>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple two column setup shows below. However in example one
I have a very simple setup, a whole solution that builds using .NET 3.5.
I have setup background image for a button as below. // declarations globally declared...
I have a HTML document with the below setup: <div class=main-div style=padding: 5px; border:
I have a very simple hover function that appears to work fine in everything
I have done a simple experiment to test MongoDB's performance and disk usage. I
I am very new to Installshield 2010. I have created a basic MSI setup
Very simple thing I'm trying to do here. I would like to have 2
Ok, so I have a very simple form with next to no logic in
The Setup I have designed a very easy to use MVC wizard. The cherry

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.