Page 1 of 1

Apache ignores file extensions

PostPosted: 19. July 2005 19:16
by mau
After spending many hours debugging a simple htaccess file, I have discovered that Apache doesn't care about file extensions any more. Going to localhost/mypage is the same as going to localhost/mypage.php, or localhost/mypage.js. Whatever it can find.

How do I disable this? There is no htaccess file that is doing this for me.

Additionally, I think maybe related, is that aliases stopped working. I used to go to localhost/phpMyAdmin to enter phpMyAdmin which is stored outside of the htdocs folder. That started giving me a 404 the other day, so I just moved it inside the htdocs folder.

Also, going to localhost/mypage/something is the same thing as going to localhost/mypage

So, how can I add back in aliases and add back in the requirement for file extensions?

PostPosted: 24. July 2005 13:15
by alucard01
Actually, what is your "mypage"? Is it a folder, a .js file, a .php file or other things?

You may find the following directive of apache suit you:

http://httpd.apache.org/docs/1.3/mod/core.html#files

By the way, I found the following directive in xampp httpd.conf:

Alias /webalizer "C:/xampp/webalizer/"

<Directory "C:/xampp/webalizer/">
Options Indexes MultiViews ExecCGI
AddHandler cgi-script .cgi .exe
Order allow,deny
Allow from all
</Directory>


It may help...

For your 2nd question, you are of couse not able to access phpmyadmin unless you put phpmyadmin under htdocs. However, if you don't want to put it under \htdocs, you can use the above "Alias" directive to map your phpmyadmin to other place.

Hope the above helps...

PostPosted: 25. July 2005 23:49
by mau
mypage can be anything, let it be about, contact, help, etc. And no, there is no folder that goes to the page name.

I think this must be a bug in Apache. I have searched around forever, asking many different people. The only suggestions I get are to "make sure there is no htaccess file" :roll: :)

PostPosted: 26. July 2005 00:05
by Wiedmann
Which XAMPP did you have? Maybe your problem have something to do with MultiViews enabled for the directory.

PostPosted: 27. July 2005 03:32
by mau
The latest version (not lite). I believe 1.0.14. Also, it's for every directory within the htdocs folder.

How would I turn multiviews off?

Thanks!

PostPosted: 27. July 2005 11:08
by Wiedmann
In the "httpd.conf", change line ~353 to:
Code: Select all
    Options Indexes FollowSymLinks Includes ExecCGI

(remove "MultiViews" from that line)

Restart Apache.

PostPosted: 27. July 2005 18:48
by mau
Yes, that's exactly what I want! Thank you very much!