iMarket Digital Properties

0 %
iMarket Digital Properties Ltd
Design · Develop · Monetize · Support
  • Location:
    United Kingdom
  • City:
    London
  • Service Area:
    Global
Business Systems
Business Services
24/7 Support
Websites
Web Applications
E-commerce Solutions
Digital Platforms
Products & Services
Public & Private Networks

Enabling Nginx mod_rewrite

January 4, 2018
https://www.digitalocean.com/community/questions/enabling-nginx-mod_rewritehttps://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/open the file below replacing ‘default’ if necessary with the sites server block:
$ sudo nano /etc/nginx/sites-available/default
Replace:
try_files $uri $uri/ =404;
with:
try_files $uri $uri/ /index.php?$args;
If using a subfolder (say /wordpress), you’ll have to add an extra location /wordpress/ block to your configuration file :location /wordpress/ { try_files $uri $uri/ /wordpress/index.php?$args; }Restart nginx:
$ sudo service nginx restart

ERRORS

Above is not working for local development. Also tried adding below code (underneath the ‘try_files…’ code and within the server block):
if (!-e $request_filename) {
    rewrite ^.*$ /index.php last;
 }

Hosting

Develop and scale your apps globally with DigitalOcean and/or Vultr – or use shared hosting with no server maintenance required at iMarketHost.com.

Installation & Maintenance

If you would like to get this app installed, maintained or need training, Contact Me to get current rates.
Posted in TutorialsTags:
4 Comments
  • xd coder

    done these but after successfully install when i’m trying to access /admin and /login and /signup page i’m getting 404 error..plz help

    6:13 pm May 13, 2021 Reply
    • Did you install to a subfolder? If you did, then the code block would be something like:

      try_files $uri $uri/ /installsubfolder/index.php?$args;

      Other than that, you would need to check the documentation of the particular app that you installed…

      7:44 am May 18, 2021 Reply
  • hello,

    i just added: try_files $uri $uri/ /index.php?$args; but the web server return 500 error

    5:00 pm May 17, 2021 Reply
    • You would need to check the documentation for the app that you installed. Other than that, if you installed the app into a subfolder you would add that to the code:

      try_files $uri $uri/ /subfolder/index.php?$args;
      7:47 am May 18, 2021 Reply
Write a comment