Apache loads any file that begins with a string used in url.

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Apache loads any file that begins with a string used in url.

Postby marshallbananas » 26. April 2010 18:06

When I point to:
mywebsite.com/search
and there is a file called search.php or search.html or search.inc.php or search.whatever.php in website's directory, Apache will point to that file instead of 404'ing.

What is even more annoying is that if I point to:
mywebsite.com/search/string?also=whatever
Apache will still display any file with filename that begins with "search.".

Also, all RewriteRules with patterns containing filenames existing in directory are ignored/useless. This is very frustrating. I don't even know where to begin searching for a solution to something ridiculous like this.

I'm using Apache 2 on Mac, unmodified httpd.conf, disabling mod_speling doesn't do anything.
How do I prevent it from redirecting my urls so freely?
marshallbananas
 
Posts: 4
Joined: 26. April 2010 18:00

Re: Apache loads any file that begins with a string used in url.

Postby MegaChriz » 28. April 2010 09:27

Are you sure your RewriteRules are right? I've had a simular problem and I noticed that I had this RewriteRule in my .htaccess:
Code: Select all
RewriteRule ^(.*)/?$ index.php?page=$1 [L]

Maybe you can post your defined RewriteRules here, so that someone can see if there could be something wrong there.

If there is nothing wrong in the .htaccess in mywebsite.com/, then another possibility is that there is a strange RewriteRule in an other .htaccess-file in a higher level directory. For example when you had put 'mywebsite.com' into /Applications/XAMPP/xamppfiles/htdocs/websites/, then the folder 'websites' could also contain a .htaccess-file.
MegaChriz
 
Posts: 158
Joined: 16. February 2009 15:04
Location: Amersfoort, The Netherlands
Operating System: Mac OS X

Re: Apache loads any file that begins with a string used in url.

Postby marshallbananas » 29. April 2010 10:45

Thanks for the reply.

I thought it might be something wrong with my RewriteRules so I disabled them but it's the same thing. So I deleted the .htaccess file - same thing. Then I even disabled the whole mod_rewrite and nothing changed. I checked the whole httpd.conf for some weird redirecting thing but it's all normal.

This is very strange, I haven't touched the .conf and it acts this way.
marshallbananas
 
Posts: 4
Joined: 26. April 2010 18:00

Re: Apache loads any file that begins with a string used in url.

Postby caltuna » 02. May 2010 03:20

Are you sure that the build in Apache is not running? Check Sys Pref, Sharing, Web Sharing is not checked.
caltuna
 
Posts: 111
Joined: 05. May 2009 16:35

Re: Apache loads any file that begins with a string used in url.

Postby marshallbananas » 03. May 2010 03:20

caltuna wrote:Are you sure that the build in Apache is not running? Check Sys Pref, Sharing, Web Sharing is not checked.

What build? Sorry, don't know what you mean.
marshallbananas
 
Posts: 4
Joined: 26. April 2010 18:00

Re: Apache loads any file that begins with a string used in url.

Postby caltuna » 04. May 2010 07:16

I meant "built in" Apache. Do what I said above with System Preferences and check.
caltuna
 
Posts: 111
Joined: 05. May 2009 16:35

Re: Apache loads any file that begins with a string used in url.

Postby marshallbananas » 04. May 2010 09:52

No, the problem I'm having is on the built in Apache and I wanted to fix that. I'm not running XAMPP.
marshallbananas
 
Posts: 4
Joined: 26. April 2010 18:00

Re: Apache loads any file that begins with a string used in url.

Postby caltuna » 06. May 2010 05:37

If this is not a problem with XAMPP, why are you posting it here?

If you are putting mywebsite.com/somefile.yyy in your browser you are telling your browser to look on the internet and use DNS servers to find the Apache (or IIS) server at the URL you are seeking.

If you are using localhost/myfile.xxx the browser is going to use your local version of Apache... either the built-in version or XAMPP if you have it and it is running.

Or did I not understand the question?
caltuna
 
Posts: 111
Joined: 05. May 2009 16:35


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 2 guests