I am presently trying to position a URL inside a URL
I am conscious that I must scribe the URL, which i've done, but now i'm obtaining a
404 error back in the server instead of my application. I believe my problem lies with apache and may be fixed using the
"AllowEncodedSlashes On" directive.
I have attempted putting the directive at the end from the httpd.conf to no effect, and am unsure how to proceed next. Am I putting it in the best place? If that's the case, does anybody have other solutions?
Edit: I am also while using CodeIgniter URL structure, in the event that helps.
I wasted a lot of hrs about this problem too. I am a bit late towards the party, however it appears there is a solution now.
According to this thread, there's (was) a bug in Apache so that for those who have
AllowEncodedSlashes On, it prevents the 404, however it incorrectly decodes the slashes, that is incorrect based on the RFC.
This comment provides a solution, namely to make use of:
This problem isn't associated with Apache Bug 35256. Rather, it relates to Bug 46830. The AllowEncodedSlashes setting isn't inherited by virtual hosts, and virtual hosts are utilized in lots of default Apache designs, like the one out of Ubuntu. The workaround would be to add the AllowEncodedSlashes setting in the VirtualHost container (/etc/apache2/sites-available/default in Ubuntu).
Bug 35256: %2F is going to be decoded in PATH_INFO (Documentation to AllowEncodedSlashes states no decoding is going to be done)
Bug 46830: If "AllowEncodedSlashes On" is occur the worldwide context, it's not inherited by virtual hosts. You have to clearly set "AllowEncodedSlashes On" in each and every container.
The documentation based on how the various configuration sections get (http://httpd.apache.org/paperwork/2.2/sections.html) states "Sections inside sections are applied following the corresponding sections outdoors the virtual host definition. This enables virtual hosts to override the primary server configuration."
I am obtaining the same issue with "AllowEncodedSlashes On", and also have attempted placing the directive inside a couple different places: apache2.conf, httpd.conf, and in the section, according to a good example at http://world wide web.jampmark.com/web-scripting/5-solutions-to-url-encoded-slashes-problem-in-apache.html.
Should you haven't already, you might like to set your logging level to debug (another directive) and find out if you achieve the mistake:
found %2f (encoded '/') in URI (decoded='/url/http://world wide web.url2.com'), coming back 404
other not found errors don't provide this data within the logs. Yet another diagnostic...
Best of luck (to the two of us)!
Following a lot of testing, and searching in the bug in Apache, I have came to the conclusion that despite offered solutions in various forums, it is really an conflicting problem in Apache. Begin to see the bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=35256
The workaround that actually works for me personally would be to refactor the URI to ensure that the product that may retain the steered clear of slashes is incorporated in the query portion of the URI, rather than the road. My tests reveal that when they're there, they do not get strained out by Apache, regardless of AllowEncodedSlashes and AcceptPathInfo configurations.
What this means is an architecture change for the project, however it appears inevitable. We do hope you found an answer.
Have you restart apache after adding the directive to httpd.conf?