Jump to content

AcceptPathInfo


phpnew

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/259573-acceptpathinfo/
Share on other sites

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.