70 likes | 83 Vues
Here is how to change default index page in .htaccess for your website.<br><br>#apache #webdevelopment #linux <br><br>Visit https://ubiq.co/tech-blog/how-to-change-default-index-page-in-apache/
E N D
Open Apache Configuration Apache configuration file is present at one of the following locations depending on your installation: /etc/apache2/httpd.conf /etc/apache2/apache2.conf /etc/httpd/httpd.conf /etc/httpd/conf/httpd.conf Open terminal and run the following command to open Apache configuration file $ sudo vi /etc/apache2/httpd.conf
Change Default Index Page You will see the following lines of code. <IfModule dir_module> DirectoryIndex index.html index.php </IfModule> Change index.html index.php to your choice of web page (e.g home.html). <IfModule dir_module> DirectoryIndex home.html </IfModule>
Change default index page using .htaccess You can also change default index page for Apache using .htaccess. Before proceeding, please enable mod_rewrite (.htaccess) in your Apache web server. Open .htaccess file, typically located at /var/www/html/.htaccess $ sudo vi /var/www/html/.htaccess
Change Default Page Using .htaccess Add the following line to .htaccess file to set index page to home.html. DirectoryIndex home.html
Restart Apache Web Server Restart Apache web server to apply changes. $ sudo service apache2 restart
Thank You Visit for details https://ubiq.co/tech-blog/how-to-change-default-index-page-in-apache/