Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
25
rated 0 times [  25] [ 0]  / answers: 1 / hits: 61253  / 3 Years ago, tue, may 4, 2021, 2:54:45

The mod_rewrite rule is not working on the virtual host.
I have wanted this for cakephp.



Is there setting to add in the virtual host file?


More From » 12.04

 Answers
4

If you are using latest apache version 2.4+ then here is the process how to enable mod_rewrite.


Go to etc/apache2/

Open apache2.conf using your favorite text editor.

Change



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


to



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


Then save it. Remember you should have root permission to edit and save this file.

Now restart apache.



service apache2 reload


This process will enable mod_rewrite for apache server including virtual host.



You can also check if it's enabled or not. Create a php script



<?php    
phpinfo();
?>


Load it from server. Under Loaded Modules section check if mod_rewrite is there or not. If it's there then it is enabled.


[#26904] Wednesday, May 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ongdiligenc

Total Points: 452
Total Questions: 111
Total Answers: 107

Location: Ukraine
Member since Sun, Dec 13, 2020
3 Years ago
;