Question

Other links than home are "404 not found" + Images not showing on new dev environment

I am currently setting up a dev environment for a small relaunch of this website (https://www.renner-print.at/). The dev domain is: http://rennerprint.tanja-kobler.com/. For that matter, I set up a new socket with needed php version, apache, nginx, mysql and pulled the current git version of the web. But all I can see is the content of the main page, even the links to some subpage dont work. The web uses Statamic as backend. Did I forget something basic? Thanks in advance for your help.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

The issues that you’ve described are usually caused by mod_rewrite not being enabled on the server.

To ensure the Apache mod_rewrite module is enabled you can run the following commands:

sudo a2enmod rewrite
sudo systemctl restart apache2

Also, ensure you have a .htaccess file at the root of your website. The .htaccess file provided by Statamic should suffice but double-check its existence and content.

Then, in your Apache configuration or virtual host configuration, make sure you have AllowOverride All set for the directory of your website:

<Directory /path/to/your/website>
    AllowOverride All
</Directory>

After that run an Apache config test and restart the service to apply the new changes.

Another thing that you could check is that the base URL is updated to reflect the new dev domain. This setting could be in the CMS’s control panel or a configuration file.

Along with the above, ensure that the paths to the images are correctly set up. If the images have an absolute URL based on the old domain, you may need to adjust these URLs to the new domain or use relative paths.

Besides the things above, if the issue persists, here are a couple more things that you could check:

  • Ensure that your web server has the proper permissions to access and read files and directories. Inappropriate permissions could prevent images from loading and might even impact the functioning of the CMS.

  • Both Nginx and Apache have error logs that can provide additional insights into what’s causing the 404 errors or other issues. Check these logs for any glaring issues:

    • Apache: /var/log/apache2/error.log
    • Nginx: /var/log/nginx/error.log

Let me know how it goes!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel