Question

im trying to redirect some subdirectories to a processor in php to handle the Requests. Basicly, that means i want to redirect www.myurl.com/members/Max to urlprocessor.php?url=members/Max, so i can process it there an get the Member-Data i need.

Im using the following Code in my .htacces, which is working.

RewriteEngine on
RewriteBase /newboots
RewriteRule ^\.htaccess$ - [F]
RewriteRule ^members(.*)$ urlprocessor.php?url=$1 [L,QSA]

But! As soon as there is a members.php in my directory, i get some Errors. Calling /members/Max is still working. Calling /members leads to a blank page. Calling /members/ leads to a blank page. Calling /members. is working (Even) calling /members.php is working

As soon as i rename members.php to sometingelse.php it's working fine again.

I dont get it :) Thanks for your help...

Was it helpful?

Solution

I believe this is due to options MultiViews being enabled in your Apache. Disable it by placing this line at the top:

Options -MultiViews
  • Option MultiViews is used by Apache's content negotiation module that runs before mod_rewrite and and makes Apache server match extensions of files. So /file can be in URL but it will serve /file.php.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top