This answer assumes that you are running apache 2.4 on ubuntu. Please provide more information about your server.
Solution 1
Check that mod_rewrite is enabled on your server by running sudo a2enmod rewrite
.
If mod_rewrite was not already enabled, restart apache by issuing the command sudo systemctl restart apache2
.
Solution 2
Ensure that your apache configuration contains the proper configuration. For example, a virtual host configuration for a development deployment might look like this:
/etc/apache2/sites-available/magentowebsite.com.conf
<VirtualHost *:80>
ServerName www.magentowebsite.com
ServerAlias magentowebsite.com www.magentowebsite.com
ServerAdmin [email protected]
DocumentRoot /var/www/magentowebsite.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/magentodev.com/public_html>
Options Indexes FollowSymLinks Multiviews
AllowOverride All
Require all granted
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
Save the file and ensure that the website is properly enabled by issuing the command:
$ sudo ln -sf /etc/apache2/sites-available/magentowebsite.com.conf /etc/apache2/sites-enabled/`
Solution 3
If your magento installation does not reside within your public folder, then issue the following commands from your magento root directory to ensure that all files are generated and symlinked within the public folder:
(The -f
argument supplied with the setup:static-content:deploy
command is required when operating in default or developer mode, but can be omitted in production mode.)
$ php bin/magento cache:flush
$ php bin/magento setup:upgrade
$ php bin/magento setup:di:compile
$ php bin/magento indexer:reindex
$ php bin/magento setup:static-content:deploy -f
$ ln -sf /var/www/magentowebsite.com/private_html/magentoroot/pub/* /var/www/magentowebsite.com/public_html/*
Restart your apache server once more and check whether the problem is solved.
Solution 4
Refer to the Magento documentation regarding file ownership and permissions and issue the commands relevant to your server configuration.
Solution 5
Read through the Magento DevDocs again and ensure that you have assigned all of the proper PHP settings. If you need to change anything, then ensure that you restart the server before trying to connect to the frontend.
If the problem persists after trying all of these solutions, please add further information about your server configuration (operating system, apache or nginx config files, php version etc.).