phpnew Posted March 23, 2012 Share Posted March 23, 2012 Hi there, I have a website on shared hosting where PHP is configured to run in CGI module. In order to have my PHP code working, I use this in .htaccess: AddHandler application/x-httpd-php5 .html .htm AddType x-mapp-php5 .html .htm But that creates an environment that returns 200 OK on URLs with trailing slash and any string after that: Example: Regular URL: example.com/page.html URL with trailing slash: example.com/page.html/whatever For the second one, it should return 404, but with PHP handler being used, it actually returns page.html with broken links which causes further creation of infinite number of pages with duplicate content. Now about AcceptPathInfo. If the server is configured as Apache module, the command AcceptPathInfo Off in .htaccess resolves this issue. But with the configuration as CGI module, it does not matter. Why is this and is there a workaround? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/259573-acceptpathinfo/ Share on other sites More sharing options...
phpnew2 Posted June 7, 2013 Share Posted June 7, 2013 Hello! I got same truble. Can someone help to fix that? Quote Link to comment https://forums.phpfreaks.com/topic/259573-acceptpathinfo/#findComment-1434734 Share on other sites More sharing options...
requinix Posted June 7, 2013 Share Posted June 7, 2013 Hello! I got same truble. Can someone help to fix that?"Same trouble" meaning that even with your AcceptPathInfo off, requests to files such as the ones OP mentioned are still being sent to your CGI-handled PHP scripts? Quote Link to comment https://forums.phpfreaks.com/topic/259573-acceptpathinfo/#findComment-1434736 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.