soumitra
soumitra

Reputation: 11

unable to convert localhost to mypage

I am not using XAMPP, WAMP, LAMP etc.

I installed APACHE, PHP and MYSQL Server directly. I also managed to update windows hosts file in windows also updated httpd-vhosts. Below is my updated script

Windows 10 pro HOSTS FILE

127.0.0.1 shreyan.com

127.0.0.1 mysqladmin

127.0.0.1 localhost

HTTPD-VHOST File


<Directory "D:/SHRNWEB" >
        Options FollowSymLinks
    AllowOverride All
        Require all granted
</Directory>


<VirtualHost *:80>
    ServerName shreyan.com
    ServerAlias www.shreyan.com
        DocumentRoot "D:/SHRNWEB/SHRNERP"    
        ErrorLog "D:/SHRNWEB/SHRNERP/error.log"
</VirtualHost>

<VirtualHost *:80>
    ServerName mysqladmin
        DocumentRoot "C:/Program Files/Apache/httpd-2.4/Apache24/htdocs/phpmyadmin"    
        ErrorLog "C:/Program Files/Apache/httpd-2.4/Apache24/htdocs/phpmyadmin/error.log"
</VirtualHost>

<VirtualHost *:80>
    ServerName localhost
        DocumentRoot "C:/Program Files/Apache/httpd-2.4/Apache24/htdocs"    
        ErrorLog "C:/Program Files/Apache/httpd-2.4/Apache24/htdocs/error.log"
</VirtualHost>

in browser localhost is showing IT WORKS (here is index.html file)

Whenever I am calling shreyan.com it is also showing IT WORKS (i have index.php file in the folder d:\SHRNWEB\SHRNERP) unable to call that.

Any help will be appreciated. Thanks in advance.

Upvotes: 0

Views: 43

Answers (1)

maiorano84
maiorano84

Reputation: 11951

By default, Apache's DirectoryIndex directive is set only to index.html. Your PHP index won't be processed unless you tell Apache about it.

This directive can support multiple values, which will allow you to specify the order in which your directory indices are preferred.

In your case, if you prefer a PHP index to be processed over an HTML index, you can write it like so:

DirectoryIndex index.php index.html

Upvotes: 0

Related Questions