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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:30:14+00:00 2026-05-31T08:30:14+00:00

I encountered some really strange behaviour in Apache. I have a standard let PHP

  • 0

I encountered some really strange behaviour in Apache. I have a standard “let PHP handle everything which isn’t a file or directory” rewrite setup.

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

This works as expected except when the URL contains %2F, which is an encoded forward slash (/). Whenever this happens, Apache responds with a 404, which is logical since none of these paths exists. But what I can’t understand, is why my rewrite rules in my .htaccess are being ignored.

TL;DR

GET /Foo/bar/baz is served by my PHP-script

GET /Foo/bar%2Fbaz is served by Apache.

  • 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-31T08:30:16+00:00Added an answer on May 31, 2026 at 8:30 am

    Found out the answer myself. The config directive AllowEncodedSlashes must be set to on for this to work. Otherwise, Apache will respond with a 404 when the URL contains an encoded forward slash or backslash.

    http://httpd.apache.org/docs/2.0/mod/core.html#allowencodedslashes

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I encountered a strange and unexpected behavior in PHP while comparing some string values.
I'm getting some strange hover behaviour from IE9 which seems to be resulting from
i've encountered some problems which i can't resolve. Any help is really appreciated. my
I've encountered some problems with MongoID. I have three models: require 'mongoid' class Configuration
Trying to get comfortable with jQuery and I have encountered some sample code that
I'm making a bookmarklet, but I've encountered some wierd behaviour in IE8. The code
I am reading some book and I have encountered a piece of code that
I have just encountered very strange problem - my GWT app hosted on Google
I've a 'C' program which has encountered a strange problem.. I'm getting segmentation fault
I'm new to C# and I have encountered some problems with my console application

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.