Mahak Choudhary
Mahak Choudhary

Reputation: 1384

How to enable MultiViews in Apache

I was trying to achieve that, If someone opens the URL /login then It should open the /login/index.php file. and it requires that multiviews needs to be enabled, I found the below options

1.Adding in the .htacces

<IfModule mod_negotiation.c>
    Options MultiViews
</IfModule>
  1. Add the multiview option to your apache conf file, like below

     <Directory /var/www/sites/foo/>
     Options +FollowSymLinks +MultiViews +Indexes
     DirectoryIndex index.php
     AddType application/x-httpd-php .php
    

but these solutions didn't work.

Upvotes: 0

Views: 1141

Answers (1)

Mahak Choudhary
Mahak Choudhary

Reputation: 1384

Finally, I found the below solution that worked for me, hope It will help someone else too.

Here is the solution :

open the below file

sudo nano /etc/apache2/mods-enabled/mime.conf

Find the below line in the file

AddType application/x-httpd-php .php .phtml .html .htm

Uncomment(If commented) and add .php If It does not contain it. Restart the server

sudo service apache2 restart

Upvotes: 1

Related Questions