/    Sign up×
Community /Pin to ProfileBookmark

Strange file serving

Probably more a question to do with Apache ?

I was mucking about with mod-rewrite the other day, and then decided to turn it all off in the http.conf and delete the .htaccess file. (i’m runnning a localhost on my machine).

There has been a strange side-effect… now for example, if i wanted contact.php to appear, typing contact, contact.php or contact/ all bring up the file – obviously, i should be getting 404s.

I’ve reset the http.conf file, but as soon as i put php into the http.conf, it starts doing it again. Its also affecting the whole of my htdocs folder.

Any ideas ?

edit : In a strange twist to this, i reverted to the http.default.conf and checked, and other file types seem to be exhibiting the same process. for example /content.jpg /content /content.j all call the same file…

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@ScleppelFeb 27.2006 — It could be [url=http://httpd.apache.org/docs/2.0/mod/mod_negotiation.html#multiviews]MultiViews[/URL].

To stop it, you have to set -MultiViews for the Options of your root directory. Somewhere in your httpd.conf file you should have a block of code like this:
[CODE]<Directory "/path/to/your/htdocs">
# the other options don't matter
# you just need -Multiviews
Options Indexes FollowSymLinks [b]-MultiViews[/b]
# some other stuff here
</Directory>[/CODe]
Copy linkTweet thisAlerts:
@bokehFeb 27.2006 — To be honest this is a very handy behaviour once you get used to it. It allows URLs without the need for a file extention.
Copy linkTweet thisAlerts:
@chickenlandauthorFeb 28.2006 — It could be [url=http://httpd.apache.org/docs/2.0/mod/mod_negotiation.html#multiviews]MultiViews[/URL].

To stop it, you have to set -MultiViews for the Options of your root directory. Somewhere in your httpd.conf file you should have a block of code like this:
[CODE]<Directory "/path/to/your/htdocs">
# the other options don't matter
# you just need -Multiviews
Options Indexes FollowSymLinks [b]-MultiViews[/b]
# some other stuff here
</Directory>[/CODe]
[/QUOTE]


Awesome, cheers ? I had set -MultiViews, but it was later declared again as MultiViews, so it must have been over-riding it. Thanks.


To be honest this is a very handy behaviour once you get used to it. It allows URLs without the need for a file extention.[/QUOTE]

Do people expect this from apache ? Is it that it does it by default and i've just never noticed it ?

I'd have used [url=http://httpd.apache.org/docs/1.3/mod/mod_negotiation.html]mod_negotiation[/url] to get the same effect...
×

Success!

Help @chickenland spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...