I have got two htaccess:
api/public/.htaccess
RewriteRule . index.php
api/public/cron/web/.htaccess
RewriteEngine On
RewriteOptions InheritBefore
I set my vhost for cron:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName cron.api.local
ServerAlias www.cron.api.local
DocumentRoot /var/www/api/public/cron/web
ErrorLog ${APACHE_LOG_DIR}/api_cron_error.log
CustomLog ${APACHE_LOG_DIR}/api_cron_access.log combined
<Directory "/var/www/api/public/cron/web">
Options Indexes FollowSymLinks MultiViews
Require all granted
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Url http://cron.api.local/up returns 404 status but when i replace RewriteOptions InheritBefore with RewriteRule . index.php then it works. What is wrong?
I use apache 2.4.18 and ubuntu 16.04.
To fix this issue follow this:
sudo nano /etc/apache2/apache2.conf
Find:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted </Directory>
Replace With:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Exit and save and restart apache with command
sudo systemctl restart apache2
Reverence: Apache mod_rewrite is enable on server but not working?