Actions

Manual/How to enable Mod Rewrite for new kiosks: Difference between revisions

From Convention Master Documentation

(Created page with "==Install/Enable Mod-rewrite in Apache== In order to use mod_rewrite you can type the following command in the terminal: sudo a2enmod rewrite Restart apache2 after sud...")
 
 
Line 22: Line 22:
==Allow Overrides so the .htaccess file works==
==Allow Overrides so the .htaccess file works==
In case you are on Ubuntu, edit the file /etc/apache2/apache2.conf(here we have an example of /srv/www):
In case you are on Ubuntu, edit the file /etc/apache2/apache2.conf(here we have an example of /srv/www):
<code>
 
   <Directory /srv/www/>
   <Directory /srv/www/>
     Options Indexes FollowSymLinks
     Options Indexes FollowSymLinks
Line 28: Line 28:
     Require all granted
     Require all granted
   </Directory>
   </Directory>
</code>
 
 
and change it to:
and change it to:
<code>
 
   <Directory /srv/www/>
   <Directory /srv/www/>
     Options Indexes FollowSymLinks
     Options Indexes FollowSymLinks
Line 36: Line 37:
     Require all granted
     Require all granted
   </Directory>
   </Directory>
</code>
 
 
Save the changes and then restart Apache so they take effect
Save the changes and then restart Apache so they take effect
   sudo service apache2 restart
   sudo service apache2 restart

Latest revision as of 14:44, 23 March 2019

Install/Enable Mod-rewrite in Apache

In order to use mod_rewrite you can type the following command in the terminal:

 sudo a2enmod rewrite


Restart apache2 after

 sudo /etc/init.d/apache2 restart


or

 sudo service apache2 restart


or as per new unified System Control Way

 sudo systemctl restart apache2


Allow Overrides so the .htaccess file works

In case you are on Ubuntu, edit the file /etc/apache2/apache2.conf(here we have an example of /srv/www):

 <Directory /srv/www/>
   Options Indexes FollowSymLinks
   AllowOverride None
   Require all granted
 </Directory>


and change it to:

 <Directory /srv/www/>
   Options Indexes FollowSymLinks
   AllowOverride All
   Require all granted
 </Directory>


Save the changes and then restart Apache so they take effect

 sudo service apache2 restart