Apache looking for .html instead of .php
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have set up a webserver on Linux.
Everything is working fine if I use .html extension.
When I change the DirectoryIndex in mij domain.conf file and restart apache / reload the config, it still does not work with .php extension.
#<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
# ServerAdmin webmaster@localhost
# DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
# ErrorLog $APACHE_LOG_DIR/error.log
# CustomLog $APACHE_LOG_DIR/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
#</VirtualHost>
<Directory /var/www/html/domain.nu/public_html>
Require all granted
</Directory>
<VirtualHost *:80>
ServerName domain.nu
ServerAlias domain.nu
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/domain/public_html/
DirectoryIndex index.php index.cgi index.pl index.html index.xhtml index.htm
ErrorLog /var/www/html/domain/logs/error.log
CustomLog /var/www/html/domain/logs/access.log combined
Redirect permanent / https://domain.nu/
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
I disabled the default 000-default.conf
file and made my own domain.nu.conf
file for the configurations.
linux apache-httpd php
add a comment |Â
up vote
1
down vote
favorite
I have set up a webserver on Linux.
Everything is working fine if I use .html extension.
When I change the DirectoryIndex in mij domain.conf file and restart apache / reload the config, it still does not work with .php extension.
#<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
# ServerAdmin webmaster@localhost
# DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
# ErrorLog $APACHE_LOG_DIR/error.log
# CustomLog $APACHE_LOG_DIR/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
#</VirtualHost>
<Directory /var/www/html/domain.nu/public_html>
Require all granted
</Directory>
<VirtualHost *:80>
ServerName domain.nu
ServerAlias domain.nu
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/domain/public_html/
DirectoryIndex index.php index.cgi index.pl index.html index.xhtml index.htm
ErrorLog /var/www/html/domain/logs/error.log
CustomLog /var/www/html/domain/logs/access.log combined
Redirect permanent / https://domain.nu/
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
I disabled the default 000-default.conf
file and made my own domain.nu.conf
file for the configurations.
linux apache-httpd php
Do you enable mod_php in apache ?
â Kiwy
Jul 4 at 13:16
Yes I did @Kiwy
â Sergio
Jul 4 at 13:20
5
Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
â ivanivan
Jul 4 at 14:23
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have set up a webserver on Linux.
Everything is working fine if I use .html extension.
When I change the DirectoryIndex in mij domain.conf file and restart apache / reload the config, it still does not work with .php extension.
#<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
# ServerAdmin webmaster@localhost
# DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
# ErrorLog $APACHE_LOG_DIR/error.log
# CustomLog $APACHE_LOG_DIR/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
#</VirtualHost>
<Directory /var/www/html/domain.nu/public_html>
Require all granted
</Directory>
<VirtualHost *:80>
ServerName domain.nu
ServerAlias domain.nu
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/domain/public_html/
DirectoryIndex index.php index.cgi index.pl index.html index.xhtml index.htm
ErrorLog /var/www/html/domain/logs/error.log
CustomLog /var/www/html/domain/logs/access.log combined
Redirect permanent / https://domain.nu/
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
I disabled the default 000-default.conf
file and made my own domain.nu.conf
file for the configurations.
linux apache-httpd php
I have set up a webserver on Linux.
Everything is working fine if I use .html extension.
When I change the DirectoryIndex in mij domain.conf file and restart apache / reload the config, it still does not work with .php extension.
#<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
# ServerAdmin webmaster@localhost
# DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
# ErrorLog $APACHE_LOG_DIR/error.log
# CustomLog $APACHE_LOG_DIR/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
#</VirtualHost>
<Directory /var/www/html/domain.nu/public_html>
Require all granted
</Directory>
<VirtualHost *:80>
ServerName domain.nu
ServerAlias domain.nu
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/domain/public_html/
DirectoryIndex index.php index.cgi index.pl index.html index.xhtml index.htm
ErrorLog /var/www/html/domain/logs/error.log
CustomLog /var/www/html/domain/logs/access.log combined
Redirect permanent / https://domain.nu/
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
I disabled the default 000-default.conf
file and made my own domain.nu.conf
file for the configurations.
linux apache-httpd php
edited Jul 4 at 13:59
Debian_yadav
8322522
8322522
asked Jul 4 at 13:12
Sergio
62
62
Do you enable mod_php in apache ?
â Kiwy
Jul 4 at 13:16
Yes I did @Kiwy
â Sergio
Jul 4 at 13:20
5
Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
â ivanivan
Jul 4 at 14:23
add a comment |Â
Do you enable mod_php in apache ?
â Kiwy
Jul 4 at 13:16
Yes I did @Kiwy
â Sergio
Jul 4 at 13:20
5
Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
â ivanivan
Jul 4 at 14:23
Do you enable mod_php in apache ?
â Kiwy
Jul 4 at 13:16
Do you enable mod_php in apache ?
â Kiwy
Jul 4 at 13:16
Yes I did @Kiwy
â Sergio
Jul 4 at 13:20
Yes I did @Kiwy
â Sergio
Jul 4 at 13:20
5
5
Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
â ivanivan
Jul 4 at 14:23
Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
â ivanivan
Jul 4 at 14:23
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f453430%2fapache-looking-for-html-instead-of-php%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Do you enable mod_php in apache ?
â Kiwy
Jul 4 at 13:16
Yes I did @Kiwy
â Sergio
Jul 4 at 13:20
5
Define "does not work with .php extension" - is it showing PHP code? Is it downloading the file? Is it displaying index.html instead of index.php?
â ivanivan
Jul 4 at 14:23